WikiEducationFoundation/WikiEduDashboard

View on GitHub

Showing 1,672 of 1,672 total issues

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

      <p>
        <a href={courseDataLink} className="button right">{I18n.t('campaign.data_courses')}</a>
        {I18n.t('campaign.data_courses_info')}
      </p>
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 30..33
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 35..38
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 40..43
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 45..48
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 50..53
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 55..58
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 32..35
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 45..48
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 50..53
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 55..58
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 60..63
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 65..68
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 70..73

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

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

      <p>
        <a href={articlesEditedLink} className="button right">{I18n.t('campaign.data_articles')}</a>
        {I18n.t('campaign.data_articles_info')}
      </p>
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 25..28
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 35..38
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 40..43
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 45..48
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 50..53
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 55..58
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 32..35
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 45..48
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 50..53
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 55..58
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 60..63
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 65..68
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 70..73

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

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

      <p>
        <a href={editorsLink} className="button right">{I18n.t('campaign.data_editor_usernames')}</a>
        {I18n.t('campaign.data_editor_usernames_info')}
      </p>
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 25..28
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 30..33
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 35..38
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 45..48
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 50..53
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 55..58
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 32..35
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 45..48
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 50..53
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 55..58
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 60..63
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 65..68
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 70..73

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

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

      <p>
        <a href={editorsByCourseLink} className="button right">{I18n.t('campaign.data_editors_by_course')}</a>
        {I18n.t('campaign.data_editors_by_course_info')}
      </p>
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 25..28
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 30..33
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 35..38
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 40..43
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 50..53
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 55..58
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 32..35
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 45..48
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 50..53
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 55..58
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 60..63
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 65..68
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 70..73

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

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

      <td className="desktop-only-tc"><a target="_blank" href={`/users/${alert.user}`}>{alert.user}</a></td>
Severity: Major
Found in app/assets/javascripts/components/alerts/alert.jsx and 1 other location - About 1 hr to fix
app/assets/javascripts/components/alerts/alert.jsx on lines 39..39

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

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

  if (document.querySelectorAll('#course_results table').length) {
    courseResultList = new List('course_results', {
      page: 500,
      valueNames: [
        'title', 'school', 'revisions', 'characters', 'references', 'average-words', 'views',
Severity: Major
Found in app/assets/javascripts/utils/course.js and 1 other location - About 1 hr to fix
app/assets/javascripts/utils/course.js on lines 21..29

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

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

      <p>
        <a href={studentsCsvLink} className="button right">{I18n.t('courses.data_students')}</a>
        {I18n.t('courses.data_students_info')}
      </p>
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 25..28
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 30..33
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 35..38
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 40..43
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 45..48
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 50..53
app/assets/javascripts/components/campaign/campaign_stats_download_modal.jsx on lines 55..58
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 32..35
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 45..48
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 50..53
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 55..58
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 65..68
app/assets/javascripts/components/overview/course_stats_download_modal.jsx on lines 70..73

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

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

    } catch (err) {
      props.addNotification({
        message: I18n.t('error_500.explanation'),
        closable: true,
        type: 'error',
Severity: Major
Found in app/assets/javascripts/components/onboarding/form.jsx and 1 other location - About 1 hr to fix
app/assets/javascripts/components/onboarding/supplementary.jsx on lines 41..48

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

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

      .catch(() => {
        props.addNotification({
          message: I18n.t('error_500.explanation'),
          closable: true,
          type: 'error'
app/assets/javascripts/components/onboarding/form.jsx on lines 67..74

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

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

      <td className="desktop-only-tc"><a target="_blank" href={`/courses/${alert.course_slug}`}>{alert.course}</a></td>
Severity: Major
Found in app/assets/javascripts/components/alerts/alert.jsx and 1 other location - About 1 hr to fix
app/assets/javascripts/components/alerts/alert.jsx on lines 40..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 59.

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

  if (document.querySelectorAll('#courses table').length) {
    courseList = new List('courses', {
      page: 500,
      valueNames: [
        'title', 'school', 'revisions', 'characters', 'references', 'average-words', 'views',
Severity: Major
Found in app/assets/javascripts/utils/course.js and 1 other location - About 1 hr to fix
app/assets/javascripts/utils/course.js on lines 34..42

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

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

Function groupByAssignmentType has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const groupByAssignmentType = (assignments, user_id) => {
  // Unassigned to anyone
  const unassignedOptions = { user_id: null, role: ASSIGNED_ROLE };
  const unassigned = getFiltered(assignments, unassignedOptions);

Severity: Minor
Found in app/assets/javascripts/components/util/helpers.js - About 1 hr to fix

    Function wiki_courses has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function wiki_courses(state = initialState, action) {
      switch (action.type) {
        case RECEIVE_WIKI_COURSES: {
          return {
            ...state,
    Severity: Minor
    Found in app/assets/javascripts/reducers/wiki_courses.js - About 1 hr to fix

      Function fetchAll has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const fetchAll = async (API_URL, params, continue_str) => {
        const allData = [];
        let continueToken;
        let hasMore = true;
        while (hasMore) {
      Severity: Minor
      Found in app/assets/javascripts/utils/mediawiki_revisions_utils.js - About 1 hr to fix

        Function SiteNoticeForm has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const SiteNoticeForm = (props) => {
          const [siteNotice, setSiteNotice] = useState();
          const dispatch = useDispatch();
        
          const handleChange = (key, value) => {

          Function NewsPopoverHandler has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const NewsPopoverHandler = () => {
            // State to track whether the create news popover should be shown or not
            const [createNews, setCreateNews] = useState(false);
            const dispatch = useDispatch();
          
          
          Severity: Minor
          Found in app/assets/javascripts/components/nav/news/news_popover_handler.jsx - About 1 hr to fix

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

                            } else {
                                this.scrollObject[name].index = length - 1;
                                this.nextPosition = paragraphs[this.scrollObject[name].index].coordinates;
                                break;
                            }
            app/assets/javascripts/components/common/ArticleViewer/utils/ArticleScroll.js on lines 137..141

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

            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

              useEffect(() => {
                // sets the title of this tab
                const header = I18n.t('instructor_view.article_assignments', { prefix });
                document.title = `${course.title} - ${header}`;
              });
            app/assets/javascripts/components/students/containers/Overview.jsx on lines 19..23

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

            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

                <div
                  onMouseEnter={() => setNewsDiscardIcon(true)} // Show red icon on hover
                  onMouseLeave={() => setNewsDiscardIcon(false)} // Show grey icon when not hovered
                  onClick={() => setCreateNews(false)} // Discard the news creation process
                  className="pop__padded-content news--content create-news-options-padded-content discard-news"
            app/assets/javascripts/components/nav/news/create_news/options/cancel_post_news.jsx on lines 13..22

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

            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

              if (Features.wikiEd && current_user.isInstructor) {
                instructorMessage = <MyArticlesInstructorMessage msg={I18n.t(`courses.${ArticleUtils.projectSuffix(course.home_wiki.project, 'instructor_message')}`)} />;
              }
            app/assets/javascripts/components/common/AssignCell/AssignCell.jsx on lines 47..49

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

            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