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 (sort.key && keys[sort.key]) keys[sort.key].order = (sort.sortKey) ? 'asc' : 'desc';
app/assets/javascripts/components/students/components/Articles/SelectedStudent/ExercisesList/StudentExercisesList.jsx on lines 72..72

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 49.

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

            <a onClick={this.stop} href={student.sandbox_url} target="_blank">{I18n.t('users.sandboxes')}</a>
app/assets/javascripts/components/students/shared/StudentList/Student/Student.jsx on lines 121..121

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 49.

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 3 locations. Consider refactoring.
Open

      <Header
        assignments={assignments}
        course={course}
        current_user={current_user}
        reviewing={reviewing}
app/assets/javascripts/components/common/ArticleViewer/components/Footer.jsx on lines 26..33
app/assets/javascripts/components/students/shared/StudentList/StudentDrawer/StudentDrawer.jsx on lines 23..30

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 49.

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 3 locations. Consider refactoring.
Open

              <Contributions
                course={course}
                revisions={revisions}
                selectedIndex={selectedIndex}
                showDiff={showDiff}
app/assets/javascripts/components/common/ArticleViewer/components/Footer.jsx on lines 26..33
app/assets/javascripts/components/students/components/Articles/SelectedStudent/SelectedStudent.jsx on lines 39..46

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 49.

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

            <a onClick={this.stop} href={student.contribution_url} target="_blank">{I18n.t('users.edits')}</a>
app/assets/javascripts/components/students/shared/StudentList/Student/Student.jsx on lines 119..119

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 49.

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

Consider simplifying this complex logical expression.
Open

      if (this.state.value === nextState.value
            && this.state.id === nextState.id
            && this.state.invalid === nextState.invalid
            && this.props.editable === nextProps.editable
            && nextProps.rerenderHoc !== true
Severity: Major
Found in app/assets/javascripts/components/high_order/input_hoc.jsx - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

    if platform.platform().lower().find('ubuntu') != -1 \
            or platform.platform().lower().find('wsl2') != -1 \
            or platform.platform().lower().find('debian') != -1 \
            or platform.platform().lower().find('elementary') != -1 \
            or platform.uname().version.lower().find('ubuntu') != -1:
    Severity: Major
    Found in setup.py - About 40 mins to fix

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

      CourseLink.propTypes = {
        to: PropTypes.string,
        className: PropTypes.string,
        onClick: PropTypes.func,
        children: PropTypes.node
      Severity: Major
      Found in app/assets/javascripts/components/common/course_link.jsx and 13 other locations - About 40 mins to fix
      app/assets/javascripts/components/activity/recent_edits_handler.jsx on lines 49..54
      app/assets/javascripts/components/activity/recent_uploads_handler.jsx on lines 38..43
      app/assets/javascripts/components/articles/available_article.jsx on lines 113..118
      app/assets/javascripts/components/articles/available_articles.jsx on lines 106..111
      app/assets/javascripts/components/articles/course_quality_progress_graph.jsx on lines 325..330
      app/assets/javascripts/components/articles/edit_size_graph.jsx on lines 157..162
      app/assets/javascripts/components/articles/wp10_graph.jsx on lines 131..136
      app/assets/javascripts/components/common/article_viewer_legend.jsx on lines 75..80
      app/assets/javascripts/components/common/course_navbar.jsx on lines 101..106
      app/assets/javascripts/components/enroll/advice_modal.jsx on lines 59..64
      app/assets/javascripts/components/nav/CustomLink.jsx on lines 14..19
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/courses_taught_graph.jsx on lines 117..122
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/students_taught_graph.jsx on lines 114..119

      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 48.

      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 14 locations. Consider refactoring.
      Open

      ArticleViewerLegend.propTypes = {
        article: PropTypes.object,
        users: PropTypes.array,
        colors: PropTypes.array,
        status: PropTypes.string
      app/assets/javascripts/components/activity/recent_edits_handler.jsx on lines 49..54
      app/assets/javascripts/components/activity/recent_uploads_handler.jsx on lines 38..43
      app/assets/javascripts/components/articles/available_article.jsx on lines 113..118
      app/assets/javascripts/components/articles/available_articles.jsx on lines 106..111
      app/assets/javascripts/components/articles/course_quality_progress_graph.jsx on lines 325..330
      app/assets/javascripts/components/articles/edit_size_graph.jsx on lines 157..162
      app/assets/javascripts/components/articles/wp10_graph.jsx on lines 131..136
      app/assets/javascripts/components/common/course_link.jsx on lines 15..20
      app/assets/javascripts/components/common/course_navbar.jsx on lines 101..106
      app/assets/javascripts/components/enroll/advice_modal.jsx on lines 59..64
      app/assets/javascripts/components/nav/CustomLink.jsx on lines 14..19
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/courses_taught_graph.jsx on lines 117..122
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/students_taught_graph.jsx on lines 114..119

      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 48.

      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 14 locations. Consider refactoring.
      Open

      AvailableArticle.propTypes = {
        assignment: PropTypes.object,
        current_user: PropTypes.object,
        course: PropTypes.object,
        selectable: PropTypes.bool
      app/assets/javascripts/components/activity/recent_edits_handler.jsx on lines 49..54
      app/assets/javascripts/components/activity/recent_uploads_handler.jsx on lines 38..43
      app/assets/javascripts/components/articles/available_articles.jsx on lines 106..111
      app/assets/javascripts/components/articles/course_quality_progress_graph.jsx on lines 325..330
      app/assets/javascripts/components/articles/edit_size_graph.jsx on lines 157..162
      app/assets/javascripts/components/articles/wp10_graph.jsx on lines 131..136
      app/assets/javascripts/components/common/article_viewer_legend.jsx on lines 75..80
      app/assets/javascripts/components/common/course_link.jsx on lines 15..20
      app/assets/javascripts/components/common/course_navbar.jsx on lines 101..106
      app/assets/javascripts/components/enroll/advice_modal.jsx on lines 59..64
      app/assets/javascripts/components/nav/CustomLink.jsx on lines 14..19
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/courses_taught_graph.jsx on lines 117..122
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/students_taught_graph.jsx on lines 114..119

      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 48.

      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 14 locations. Consider refactoring.
      Open

      EditSizeGraph.propTypes = {
        graphid: PropTypes.string,
        graphWidth: PropTypes.number,
        graphHeight: PropTypes.number,
        articleData: PropTypes.array
      app/assets/javascripts/components/activity/recent_edits_handler.jsx on lines 49..54
      app/assets/javascripts/components/activity/recent_uploads_handler.jsx on lines 38..43
      app/assets/javascripts/components/articles/available_article.jsx on lines 113..118
      app/assets/javascripts/components/articles/available_articles.jsx on lines 106..111
      app/assets/javascripts/components/articles/course_quality_progress_graph.jsx on lines 325..330
      app/assets/javascripts/components/articles/wp10_graph.jsx on lines 131..136
      app/assets/javascripts/components/common/article_viewer_legend.jsx on lines 75..80
      app/assets/javascripts/components/common/course_link.jsx on lines 15..20
      app/assets/javascripts/components/common/course_navbar.jsx on lines 101..106
      app/assets/javascripts/components/enroll/advice_modal.jsx on lines 59..64
      app/assets/javascripts/components/nav/CustomLink.jsx on lines 14..19
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/courses_taught_graph.jsx on lines 117..122
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/students_taught_graph.jsx on lines 114..119

      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 48.

      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 14 locations. Consider refactoring.
      Open

      CourseQualityProgressGraph.propTypes = {
        graphid: PropTypes.string,
        graphWidth: PropTypes.number,
        graphHeight: PropTypes.number,
        articleData: PropTypes.array,
      app/assets/javascripts/components/activity/recent_edits_handler.jsx on lines 49..54
      app/assets/javascripts/components/activity/recent_uploads_handler.jsx on lines 38..43
      app/assets/javascripts/components/articles/available_article.jsx on lines 113..118
      app/assets/javascripts/components/articles/available_articles.jsx on lines 106..111
      app/assets/javascripts/components/articles/edit_size_graph.jsx on lines 157..162
      app/assets/javascripts/components/articles/wp10_graph.jsx on lines 131..136
      app/assets/javascripts/components/common/article_viewer_legend.jsx on lines 75..80
      app/assets/javascripts/components/common/course_link.jsx on lines 15..20
      app/assets/javascripts/components/common/course_navbar.jsx on lines 101..106
      app/assets/javascripts/components/enroll/advice_modal.jsx on lines 59..64
      app/assets/javascripts/components/nav/CustomLink.jsx on lines 14..19
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/courses_taught_graph.jsx on lines 117..122
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/students_taught_graph.jsx on lines 114..119

      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 48.

      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 8 locations. Consider refactoring.
      Open

                  <TextInput
                    id="added_words"
                    editable
                    onChange={handleChange}
                    value={stats.added_words}
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 23..31
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 32..40
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 41..49
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 59..67
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 68..76
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 77..85
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 86..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 48.

      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 8 locations. Consider refactoring.
      Open

                  <TextInput
                    id="article_views"
                    editable
                    onChange={handleChange}
                    value={stats.article_views}
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 23..31
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 32..40
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 41..49
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 50..58
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 59..67
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 68..76
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 86..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 48.

      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 14 locations. Consider refactoring.
      Open

      AvailableArticles.propTypes = {
        course_id: PropTypes.string,
        course: PropTypes.object,
        current_user: PropTypes.object,
        assignments: PropTypes.array,
      app/assets/javascripts/components/activity/recent_edits_handler.jsx on lines 49..54
      app/assets/javascripts/components/activity/recent_uploads_handler.jsx on lines 38..43
      app/assets/javascripts/components/articles/available_article.jsx on lines 113..118
      app/assets/javascripts/components/articles/course_quality_progress_graph.jsx on lines 325..330
      app/assets/javascripts/components/articles/edit_size_graph.jsx on lines 157..162
      app/assets/javascripts/components/articles/wp10_graph.jsx on lines 131..136
      app/assets/javascripts/components/common/article_viewer_legend.jsx on lines 75..80
      app/assets/javascripts/components/common/course_link.jsx on lines 15..20
      app/assets/javascripts/components/common/course_navbar.jsx on lines 101..106
      app/assets/javascripts/components/enroll/advice_modal.jsx on lines 59..64
      app/assets/javascripts/components/nav/CustomLink.jsx on lines 14..19
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/courses_taught_graph.jsx on lines 117..122
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/students_taught_graph.jsx on lines 114..119

      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 48.

      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 14 locations. Consider refactoring.
      Open

      RecentEditsHandler.propTypes = {
        fetchRecentEdits: PropTypes.func,
        sortRecentEdits: PropTypes.func,
        revisions: PropTypes.array,
        loading: PropTypes.bool
      app/assets/javascripts/components/activity/recent_uploads_handler.jsx on lines 38..43
      app/assets/javascripts/components/articles/available_article.jsx on lines 113..118
      app/assets/javascripts/components/articles/available_articles.jsx on lines 106..111
      app/assets/javascripts/components/articles/course_quality_progress_graph.jsx on lines 325..330
      app/assets/javascripts/components/articles/edit_size_graph.jsx on lines 157..162
      app/assets/javascripts/components/articles/wp10_graph.jsx on lines 131..136
      app/assets/javascripts/components/common/article_viewer_legend.jsx on lines 75..80
      app/assets/javascripts/components/common/course_link.jsx on lines 15..20
      app/assets/javascripts/components/common/course_navbar.jsx on lines 101..106
      app/assets/javascripts/components/enroll/advice_modal.jsx on lines 59..64
      app/assets/javascripts/components/nav/CustomLink.jsx on lines 14..19
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/courses_taught_graph.jsx on lines 117..122
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/students_taught_graph.jsx on lines 114..119

      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 48.

      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 8 locations. Consider refactoring.
      Open

                  <TextInput
                    id="total_pages"
                    editable
                    onChange={handleChange}
                    value={stats.total_pages}
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 23..31
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 32..40
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 41..49
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 50..58
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 68..76
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 77..85
      app/assets/javascripts/components/settings/views/impact_stats_form.jsx on lines 86..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 48.

      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 14 locations. Consider refactoring.
      Open

      AdviceModal.propTypes = {
        user: PropTypes.object,
        course: PropTypes.object,
        passcode: PropTypes.string,
        setModalShown: PropTypes.func,
      Severity: Major
      Found in app/assets/javascripts/components/enroll/advice_modal.jsx and 13 other locations - About 40 mins to fix
      app/assets/javascripts/components/activity/recent_edits_handler.jsx on lines 49..54
      app/assets/javascripts/components/activity/recent_uploads_handler.jsx on lines 38..43
      app/assets/javascripts/components/articles/available_article.jsx on lines 113..118
      app/assets/javascripts/components/articles/available_articles.jsx on lines 106..111
      app/assets/javascripts/components/articles/course_quality_progress_graph.jsx on lines 325..330
      app/assets/javascripts/components/articles/edit_size_graph.jsx on lines 157..162
      app/assets/javascripts/components/articles/wp10_graph.jsx on lines 131..136
      app/assets/javascripts/components/common/article_viewer_legend.jsx on lines 75..80
      app/assets/javascripts/components/common/course_link.jsx on lines 15..20
      app/assets/javascripts/components/common/course_navbar.jsx on lines 101..106
      app/assets/javascripts/components/nav/CustomLink.jsx on lines 14..19
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/courses_taught_graph.jsx on lines 117..122
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/students_taught_graph.jsx on lines 114..119

      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 48.

      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 5 locations. Consider refactoring.
      Open

      const WikiSelect = ({ multi, onChange, styles, wikis, homeWiki, readOnly, label, id, options }) => {
        // Function to generate URL for a wiki
        const url = useCallback((wiki) => {
          const subdomain = wiki.language || 'www';
          return `${subdomain}.${wiki.project}.org`;
      Severity: Major
      Found in app/assets/javascripts/components/common/wiki_select.jsx and 4 other locations - About 40 mins to fix
      app/assets/javascripts/components/common/list.jsx on lines 5..155
      app/assets/javascripts/components/common/weekday_picker.jsx on lines 23..197
      app/assets/javascripts/components/timeline/TrainingModules/ModuleRow/ModuleStatus/ExerciseButton.jsx on lines 4..36
      app/assets/javascripts/components/timeline/empty_week.jsx on lines 6..82

      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 48.

      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 14 locations. Consider refactoring.
      Open

      Wp10Graph.propTypes = {
        graphid: PropTypes.string,
        graphWidth: PropTypes.number,
        graphHeight: PropTypes.number,
        articleData: PropTypes.array
      Severity: Major
      Found in app/assets/javascripts/components/articles/wp10_graph.jsx and 13 other locations - About 40 mins to fix
      app/assets/javascripts/components/activity/recent_edits_handler.jsx on lines 49..54
      app/assets/javascripts/components/activity/recent_uploads_handler.jsx on lines 38..43
      app/assets/javascripts/components/articles/available_article.jsx on lines 113..118
      app/assets/javascripts/components/articles/available_articles.jsx on lines 106..111
      app/assets/javascripts/components/articles/course_quality_progress_graph.jsx on lines 325..330
      app/assets/javascripts/components/articles/edit_size_graph.jsx on lines 157..162
      app/assets/javascripts/components/common/article_viewer_legend.jsx on lines 75..80
      app/assets/javascripts/components/common/course_link.jsx on lines 15..20
      app/assets/javascripts/components/common/course_navbar.jsx on lines 101..106
      app/assets/javascripts/components/enroll/advice_modal.jsx on lines 59..64
      app/assets/javascripts/components/nav/CustomLink.jsx on lines 14..19
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/courses_taught_graph.jsx on lines 117..122
      app/assets/javascripts/components/user_profiles/graphs/as_instructor_graphs/students_taught_graph.jsx on lines 114..119

      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 48.

      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

      Severity
      Category
      Status
      Source
      Language