Coursemology/coursemology2

View on GitHub

Showing 1,205 of 1,252 total issues

Function updatePostOnServer has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function updatePostOnServer(postId) {
  return (dispatch, getState) => {
    const state = getState();
    const post = state.discussion.posts.get(postId);
    const text = post.editedContent;
Severity: Minor
Found in client/app/bundles/course/video/submission/actions/discussion.js - About 1 hr to fix

Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const { includePhantoms, answers, anonymous } = this.props;
    const filteredAnswers = includePhantoms
      ? answers
      : answers.filter((answer) => !answer.phantom);

Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    return (
      <>
        <Button
          onClick={() => this.setState({ open: true })}

Function RenderImageField has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const RenderImageField = (props) => {
  const { field, index, disabled } = props;
  const fieldId = `option-${index}-image-field`;
  const inputRef = useRef(null);
  return (

Function mapButtonObjectToElement has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function mapButtonObjectToElement(button, isLast) {
  if (button.icon) {
    return (
      <Tooltip key={`tooltip_${button.label.props.id}`} title={button.label}>
        <IconButton
Severity: Minor
Found in client/app/bundles/course/group/components/GroupCard.jsx - About 1 hr to fix

Function renderComments has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderComments = () => {
    const { answerId, fileId, expanded } = props;

    if (expanded[lineNumber - 1]) {
      return (

Function renderTextResponseComprehensionGroup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function renderTextResponseComprehensionGroup(group) {
  return (
    <>
      <br />
      <Typography variant="h6">

Function renderTabs has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderTabs(myStudentsExist) {
    return (
      <Tabs
        className="border-only-y-neutral-200"
        onChange={(_, value) => this.setState({ tab: value })}

Function MuiTableHeader has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      {props.headers.map((header, index) => {
        const headerProps = props.forEach(header, index);

        return (
          <TableCell
Severity: Minor
Found in client/app/lib/components/table/MuiTableAdapter/MuiTableHeader.tsx - About 1 hr to fix

Function ExperiencePointsTable has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ExperiencePointsTable: FC<Props> = (props) => {
  const { isStudentPage, isLoading, disabled, records } = props;

  const { t } = useTranslation();

Function SidebarAccordion has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const SidebarAccordion = (props: SidebarAccordionProps): JSX.Element => {
  const { containing: items, title } = props;

  return (
    <Accordion
Severity: Minor
Found in client/app/bundles/course/container/Sidebar/SidebarAccordion.tsx - About 1 hr to fix

Function UserShow has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const UserShow: FC<Props> = () => {
  const [isLoading, setIsLoading] = useState(true);
  const dispatch = useAppDispatch();
  const { userId } = useParams();
  const user = useAppSelector((state) => getUserEntity(state, +userId!));
Severity: Minor
Found in client/app/bundles/course/users/pages/UserShow/index.tsx - About 1 hr to fix

Function DuplicatesAlert has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const DuplicatesAlert = (props: DuplicatesAlertProps): JSX.Element | null => {
  const { of: duplicates } = props;

  const { t } = useTranslation();

Function handleDelete has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const handleDelete = (): Promise<void> => {
    setIsCreating(false);
    if (item.new) {
      return new Promise<void>(() => {});
    }

Function WatchVideoButton has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const WatchVideoButton: FC<Props> = (props) => {
  const { video, intl } = props;

  const { courseId } = useParams();

Function AdminNavigator has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AdminNavigator = (): JSX.Element => {
  const { t } = useTranslation();

  return (
    <AdminNavigablePage
Severity: Minor
Found in client/app/bundles/system/admin/admin/AdminNavigator.tsx - About 1 hr to fix

Function SignUpLandingPage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const SignUpLandingPage = (): JSX.Element | null => {
  const { t } = useTranslation();

  const email = useEmailFromLocationState();
  if (!email) return <Navigate to="/users/sign_up" />;
Severity: Minor
Found in client/app/bundles/users/pages/SignUpLandingPage.tsx - About 1 hr to fix

Function updateResponse has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function updateResponse(
  responseId,
  payload,
  successMessage,
  failureMessage,
Severity: Minor
Found in client/app/bundles/course/survey/actions/responses.js - About 1 hr to fix

Function publish has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function publish(submissionId, grades, exp) {
  const payload = {
    submission: {
      answers: grades,
      draft_points_awarded: exp,
Severity: Minor
Found in client/app/bundles/course/assessment/submission/actions/index.js - About 1 hr to fix

Function renderPublishToggle has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderPublishToggle = (survey) => {
    const { dispatch } = props;
    if (!survey.canUpdate) {
      return null;
    }
Severity: Minor
Found in client/app/bundles/course/survey/pages/SurveyIndex/SurveysTable.jsx - About 1 hr to fix
Severity
Category
Status
Source
Language