WikiEducationFoundation/WikiEduDashboard

View on GitHub

Showing 1,672 of 1,672 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      if (assignment.role === 0 && assignment.user_id && assignment.username) {
        const usernameLink = userLink(props.course.home_wiki, assignment);
        assignees.push(usernameLink);
        assignees.push(', ');
      } else if (assignment.role === 1 && assignment.user_id && assignment.username) {
Severity: Minor
Found in app/assets/javascripts/components/assignments/assignment.jsx and 1 other location - About 35 mins to fix
app/assets/javascripts/components/assignments/assignment.jsx on lines 36..40

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          <button disabled={disabled} type="submit" className="button dark right">
            {submitText} <i className="icon3 icon-rt_arrow" />
          </button>
Severity: Minor
Found in app/assets/javascripts/components/onboarding/supplementary.jsx and 1 other location - About 35 mins to fix
app/assets/javascripts/components/onboarding/form.jsx on lines 170..172

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      } else if (assignment.role === 1 && assignment.user_id && assignment.username) {
        const usernameLink = userLink(props.course.home_wiki, assignment);
        reviewers.push(usernameLink);
        reviewers.push(', ');
      }
Severity: Minor
Found in app/assets/javascripts/components/assignments/assignment.jsx and 1 other location - About 35 mins to fix
app/assets/javascripts/components/assignments/assignment.jsx on lines 32..40

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        {topicGuidesBlocks.map(block => <Block key={block.id} block={block} trainingLibrarySlug={trainingLibrarySlug} />)}
Severity: Minor
Found in app/assets/javascripts/components/resources/handouts.jsx and 1 other location - About 35 mins to fix
app/assets/javascripts/components/resources/resources.jsx on lines 83..83

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  const tooltip = (
    <div className="tooltip dark">
      <p>{I18n.t('timeline.block_type')}</p>
    </div>
  );
app/assets/javascripts/components/common/feedback.jsx on lines 95..99

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  assignments = assignments.map((assignment) => {
    assignment.reviewers = reviewersList[assignment.article_title] || null;
    return assignment;
  });
app/assets/javascripts/components/overview/my_articles/utils/processAssignments.js on lines 91..94

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  return (
    <div id="course-details">
      <h3>{I18n.t('courses.course_details')}</h3>
      {elements}
    </div>
app/assets/javascripts/components/user_profiles/contribution_stats.jsx on lines 38..43

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        <button disabled={disabled} type="submit" className="button dark right">
          {submitText} <i className="icon icon-rt_arrow" />
        </button>
Severity: Minor
Found in app/assets/javascripts/components/onboarding/form.jsx and 1 other location - About 35 mins to fix
app/assets/javascripts/components/onboarding/supplementary.jsx on lines 128..130

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        {additionalResourcesBlocks.map(block => <Block key={block.id} block={block} trainingLibrarySlug={trainingLibrarySlug} />)}
Severity: Minor
Found in app/assets/javascripts/components/resources/resources.jsx and 1 other location - About 35 mins to fix
app/assets/javascripts/components/resources/handouts.jsx on lines 19..19

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Avoid too many return statements within this function.
Open

      return {
        ...state,
        blocks: {
          ...state.blocks,
          [block.id]: block
Severity: Major
Found in app/assets/javascripts/reducers/timeline.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return { ...state, trackedStatusFilter: action.trackedStatus };
    Severity: Major
    Found in app/assets/javascripts/reducers/articles.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return setValidation('exists', false, action.message, true, state);
      Severity: Major
      Found in app/assets/javascripts/reducers/validations.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return { ...state, activeIndex: action.toPanelIndex };
        Severity: Major
        Found in app/assets/javascripts/reducers/wizard.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

            return 'unknown error';
          Severity: Major
          Found in app/assets/javascripts/actions/new_account_actions.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return {
                    ...state,
                    petscan: {
                      ...state.petscan,
                      psids: action.psids
            Severity: Major
            Found in app/assets/javascripts/reducers/scoping_methods.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return {
                      ...state,
                      articles: newStateArticles,
                      continue_results: continueResults,
                      cmcontinue: cmcontinue,
              Severity: Major
              Found in app/assets/javascripts/reducers/article_finder.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return {
                        ...state,
                        articles: newStateArticles,
                        continue_results: continueResults,
                        offset: offset,
                Severity: Major
                Found in app/assets/javascripts/reducers/article_finder.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return { ...state, blocks: updatedBlocks };
                  Severity: Major
                  Found in app/assets/javascripts/reducers/timeline.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return newState;
                    Severity: Major
                    Found in app/assets/javascripts/reducers/notifications.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return I18n.t('courses.new_account_username_taken');
                      Severity: Major
                      Found in app/assets/javascripts/actions/new_account_actions.js - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language