WikiEducationFoundation/WikiEduDashboard

View on GitHub

Showing 1,672 of 1,672 total issues

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

const VideoLink = ({ link, title }) => (
  <tr className="training-module">
    <td className="block__training-modules-table__module-name">{ title }</td>
    <td className="block__training-modules-table__module-link">
      <a href={link} target="_blank">
Severity: Major
Found in app/assets/javascripts/components/resources/videos.jsx and 1 other location - About 3 hrs to fix
app/assets/javascripts/components/resources/templates.jsx on lines 3..13

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

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 renderGraph has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderGraph = () => {
    const vegaSpec = {
      width: props.graphWidth,
      height: props.graphHeight,
      padding: 5,
Severity: Major
Found in app/assets/javascripts/components/articles/wp10_graph.jsx - About 3 hrs to fix

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

      if (course.timeline_enabled) {
        const timelineLink = `${courseLink}/timeline`;
        timeline = (
          <div className="nav__item" id="timeline-link">
            <p><NavLink to={timelineLink} className={({ isActive }) => (isActive ? 'active' : '')}>{I18n.t('courses.timeline_link')}</NavLink></p>
    Severity: Major
    Found in app/assets/javascripts/components/common/course_navbar.jsx and 1 other location - About 3 hrs to fix
    app/assets/javascripts/components/common/course_navbar.jsx on lines 45..52

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

    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 (course.timeline_enabled) {
        const resourcesLink = `${courseLink}/resources`;
        resources = (
          <div className="nav__item" id="resources-link">
            <p><NavLink to={resourcesLink} className={({ isActive }) => (isActive ? 'active' : '')}>{I18n.t('resources.label')}</NavLink></p>
    Severity: Major
    Found in app/assets/javascripts/components/common/course_navbar.jsx and 1 other location - About 3 hrs to fix
    app/assets/javascripts/components/common/course_navbar.jsx on lines 35..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 112.

    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
                  className={`radio-wrapped ${
                    state.instructor === 'true' ? 'checked' : ''
                  }`}
                >
    Severity: Major
    Found in app/assets/javascripts/components/onboarding/form.jsx and 1 other location - About 3 hrs to fix
    app/assets/javascripts/components/onboarding/form.jsx on lines 151..167

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

    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
                  className={`radio-wrapped ${
                    state.instructor === 'false' ? 'checked' : ''
                  }`}
                >
    Severity: Major
    Found in app/assets/javascripts/components/onboarding/form.jsx and 1 other location - About 3 hrs to fix
    app/assets/javascripts/components/onboarding/form.jsx on lines 134..150

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

    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 {
            const className = `button small add-available-article ${isLoading ? 'disabled' : 'dark'}`;
            button = (
              <td>
                <button className={className} onClick={() => assignArticle()}>{I18n.t(`article_finder.${ArticleUtils.projectSuffix(props.selectedWiki.project, 'add_available_article')}`)}</button>
    app/assets/javascripts/components/article_finder/article_finder_row.jsx on lines 117..124

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

    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 (props.assignment) {
            const className = `button small add-available-article ${isLoading ? 'disabled' : ''}`;
            button = (
              <td>
                <button className={className} onClick={() => unassignArticle()}>{I18n.t(`article_finder.${ArticleUtils.projectSuffix(props.selectedWiki.project, 'remove_article')}`)}</button>
    app/assets/javascripts/components/article_finder/article_finder_row.jsx on lines 124..131

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

    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 render has 96 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        const modifiers = {
          ['outrange']: (day) => {
            return !this.inrange(day);
          },
    Severity: Major
    Found in app/assets/javascripts/components/common/calendar.jsx - About 3 hrs to fix

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

        test('correctly parses mobile Wikipedia redlinks', () => {
          const input = 'https://en.m.wikipedia.org/w/index.php?title=Red_link&action=edit&redlink=1';
          const output = courseUtils.articleFromTitleInput(input);
          expect(output.title).toBe('Red link');
          expect(output.project).toBe('wikipedia');
      Severity: Major
      Found in test/utils/course_utils.spec.js and 13 other locations - About 3 hrs to fix
      test/utils/course_utils.spec.js on lines 100..107
      test/utils/course_utils.spec.js on lines 109..116
      test/utils/course_utils.spec.js on lines 118..125
      test/utils/course_utils.spec.js on lines 127..134
      test/utils/course_utils.spec.js on lines 136..143
      test/utils/course_utils.spec.js on lines 145..152
      test/utils/course_utils.spec.js on lines 154..161
      test/utils/course_utils.spec.js on lines 163..170
      test/utils/course_utils.spec.js on lines 172..179
      test/utils/course_utils.spec.js on lines 181..188
      test/utils/course_utils.spec.js on lines 199..206
      test/utils/course_utils.spec.js on lines 208..215
      test/utils/course_utils.spec.js on lines 217..224

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

      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

        test('handles url-encoded characters in Wikipedia urls', () => {
          const input = 'https://es.wikipedia.org/wiki/Jalape%C3%B1o';
          const output = courseUtils.articleFromTitleInput(input);
          expect(output.title).toBe('Jalapeño');
          expect(output.project).toBe('wikipedia');
      Severity: Major
      Found in test/utils/course_utils.spec.js and 13 other locations - About 3 hrs to fix
      test/utils/course_utils.spec.js on lines 100..107
      test/utils/course_utils.spec.js on lines 109..116
      test/utils/course_utils.spec.js on lines 118..125
      test/utils/course_utils.spec.js on lines 127..134
      test/utils/course_utils.spec.js on lines 145..152
      test/utils/course_utils.spec.js on lines 154..161
      test/utils/course_utils.spec.js on lines 163..170
      test/utils/course_utils.spec.js on lines 172..179
      test/utils/course_utils.spec.js on lines 181..188
      test/utils/course_utils.spec.js on lines 190..197
      test/utils/course_utils.spec.js on lines 199..206
      test/utils/course_utils.spec.js on lines 208..215
      test/utils/course_utils.spec.js on lines 217..224

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

      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

        test('correctly parses wikipedia redlinks (variation: Section edit link)', () => {
          const input = 'https://en.wikipedia.org/w/index.php?title=Sweetwater_Formation&action=edit&section=2';
          const output = courseUtils.articleFromTitleInput(input);
          expect(output.title).toBe('Sweetwater Formation');
          expect(output.project).toBe('wikipedia');
      Severity: Major
      Found in test/utils/course_utils.spec.js and 13 other locations - About 3 hrs to fix
      test/utils/course_utils.spec.js on lines 100..107
      test/utils/course_utils.spec.js on lines 109..116
      test/utils/course_utils.spec.js on lines 118..125
      test/utils/course_utils.spec.js on lines 127..134
      test/utils/course_utils.spec.js on lines 136..143
      test/utils/course_utils.spec.js on lines 145..152
      test/utils/course_utils.spec.js on lines 154..161
      test/utils/course_utils.spec.js on lines 172..179
      test/utils/course_utils.spec.js on lines 181..188
      test/utils/course_utils.spec.js on lines 190..197
      test/utils/course_utils.spec.js on lines 199..206
      test/utils/course_utils.spec.js on lines 208..215
      test/utils/course_utils.spec.js on lines 217..224

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

      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

        test('correctly parses the wikimedia incubator url', () => {
          const input = 'https://incubator.wikimedia.org/wiki/Wp/kiu/Heyder_Cansa';
          const output = courseUtils.articleFromTitleInput(input);
          expect(output.title).toBe('Wp/kiu/Heyder Cansa');
          expect(output.project).toBe('wikimedia');
      Severity: Major
      Found in test/utils/course_utils.spec.js and 13 other locations - About 3 hrs to fix
      test/utils/course_utils.spec.js on lines 100..107
      test/utils/course_utils.spec.js on lines 109..116
      test/utils/course_utils.spec.js on lines 118..125
      test/utils/course_utils.spec.js on lines 136..143
      test/utils/course_utils.spec.js on lines 145..152
      test/utils/course_utils.spec.js on lines 154..161
      test/utils/course_utils.spec.js on lines 163..170
      test/utils/course_utils.spec.js on lines 172..179
      test/utils/course_utils.spec.js on lines 181..188
      test/utils/course_utils.spec.js on lines 190..197
      test/utils/course_utils.spec.js on lines 199..206
      test/utils/course_utils.spec.js on lines 208..215
      test/utils/course_utils.spec.js on lines 217..224

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

      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

        test('correctly parses wikipedia redlinks (variation: The edit link for an older revision)', () => {
          const input = 'https://en.wikipedia.org/w/index.php?title=72nd_Primetime_Emmy_Awards&oldid=980777920&action=edit';
          const output = courseUtils.articleFromTitleInput(input);
          expect(output.title).toBe('72nd Primetime Emmy Awards');
          expect(output.project).toBe('wikipedia');
      Severity: Major
      Found in test/utils/course_utils.spec.js and 13 other locations - About 3 hrs to fix
      test/utils/course_utils.spec.js on lines 100..107
      test/utils/course_utils.spec.js on lines 109..116
      test/utils/course_utils.spec.js on lines 118..125
      test/utils/course_utils.spec.js on lines 127..134
      test/utils/course_utils.spec.js on lines 136..143
      test/utils/course_utils.spec.js on lines 145..152
      test/utils/course_utils.spec.js on lines 163..170
      test/utils/course_utils.spec.js on lines 172..179
      test/utils/course_utils.spec.js on lines 181..188
      test/utils/course_utils.spec.js on lines 190..197
      test/utils/course_utils.spec.js on lines 199..206
      test/utils/course_utils.spec.js on lines 208..215
      test/utils/course_utils.spec.js on lines 217..224

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

      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

        test('correctly parses wikipedia redlinks (variation: Old version edit link using VisualEditor)', () => {
          const input = ' https://en.wikipedia.org/w/index.php?title=Christian_Social_Party_of_Obwalden&oldid=886780353&veaction=editsource';
          const output = courseUtils.articleFromTitleInput(input);
          expect(output.title).toBe('Christian Social Party of Obwalden');
          expect(output.project).toBe('wikipedia');
      Severity: Major
      Found in test/utils/course_utils.spec.js and 13 other locations - About 3 hrs to fix
      test/utils/course_utils.spec.js on lines 100..107
      test/utils/course_utils.spec.js on lines 109..116
      test/utils/course_utils.spec.js on lines 118..125
      test/utils/course_utils.spec.js on lines 127..134
      test/utils/course_utils.spec.js on lines 136..143
      test/utils/course_utils.spec.js on lines 145..152
      test/utils/course_utils.spec.js on lines 154..161
      test/utils/course_utils.spec.js on lines 163..170
      test/utils/course_utils.spec.js on lines 172..179
      test/utils/course_utils.spec.js on lines 190..197
      test/utils/course_utils.spec.js on lines 199..206
      test/utils/course_utils.spec.js on lines 208..215
      test/utils/course_utils.spec.js on lines 217..224

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

      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

        test("correctly parses multilingual wikisource url's", () => {
          const input = 'https://wikisource.org/wiki/Heyder_Cansa';
          const output = courseUtils.articleFromTitleInput(input);
          expect(output.title).toBe('Heyder Cansa');
          expect(output.project).toBe('wikisource');
      Severity: Major
      Found in test/utils/course_utils.spec.js and 13 other locations - About 3 hrs to fix
      test/utils/course_utils.spec.js on lines 100..107
      test/utils/course_utils.spec.js on lines 109..116
      test/utils/course_utils.spec.js on lines 127..134
      test/utils/course_utils.spec.js on lines 136..143
      test/utils/course_utils.spec.js on lines 145..152
      test/utils/course_utils.spec.js on lines 154..161
      test/utils/course_utils.spec.js on lines 163..170
      test/utils/course_utils.spec.js on lines 172..179
      test/utils/course_utils.spec.js on lines 181..188
      test/utils/course_utils.spec.js on lines 190..197
      test/utils/course_utils.spec.js on lines 199..206
      test/utils/course_utils.spec.js on lines 208..215
      test/utils/course_utils.spec.js on lines 217..224

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

      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

        test('correctly parses Wikimedia redlinks', () => {
          const input = 'https://incubator.wikimedia.org/w/index.php?title=Redlink&action=edit&redlink=1';
          const output = courseUtils.articleFromTitleInput(input);
          expect(output.title).toBe('Redlink');
          expect(output.project).toBe('wikimedia');
      Severity: Major
      Found in test/utils/course_utils.spec.js and 13 other locations - About 3 hrs to fix
      test/utils/course_utils.spec.js on lines 100..107
      test/utils/course_utils.spec.js on lines 109..116
      test/utils/course_utils.spec.js on lines 118..125
      test/utils/course_utils.spec.js on lines 127..134
      test/utils/course_utils.spec.js on lines 136..143
      test/utils/course_utils.spec.js on lines 145..152
      test/utils/course_utils.spec.js on lines 154..161
      test/utils/course_utils.spec.js on lines 163..170
      test/utils/course_utils.spec.js on lines 172..179
      test/utils/course_utils.spec.js on lines 181..188
      test/utils/course_utils.spec.js on lines 190..197
      test/utils/course_utils.spec.js on lines 208..215
      test/utils/course_utils.spec.js on lines 217..224

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

      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

        test('handles url-encoded characters in Wikipedia redlinks -- #1', () => {
          const input = 'https://en.wikipedia.org/w/index.php?title=Jalape%C3%B1o&action=edit&redlink=1';
          const output = courseUtils.articleFromTitleInput(input);
          expect(output.title).toBe('Jalapeño');
          expect(output.project).toBe('wikipedia');
      Severity: Major
      Found in test/utils/course_utils.spec.js and 13 other locations - About 3 hrs to fix
      test/utils/course_utils.spec.js on lines 100..107
      test/utils/course_utils.spec.js on lines 109..116
      test/utils/course_utils.spec.js on lines 118..125
      test/utils/course_utils.spec.js on lines 127..134
      test/utils/course_utils.spec.js on lines 136..143
      test/utils/course_utils.spec.js on lines 145..152
      test/utils/course_utils.spec.js on lines 154..161
      test/utils/course_utils.spec.js on lines 163..170
      test/utils/course_utils.spec.js on lines 172..179
      test/utils/course_utils.spec.js on lines 181..188
      test/utils/course_utils.spec.js on lines 190..197
      test/utils/course_utils.spec.js on lines 199..206
      test/utils/course_utils.spec.js on lines 217..224

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

      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

        test('correctly parses Wikipedia redlinks', () => {
          const input = 'https://en.wikipedia.org/w/index.php?title=Redlink&action=edit&redlink=1';
          const output = courseUtils.articleFromTitleInput(input);
          expect(output.title).toBe('Redlink');
          expect(output.project).toBe('wikipedia');
      Severity: Major
      Found in test/utils/course_utils.spec.js and 13 other locations - About 3 hrs to fix
      test/utils/course_utils.spec.js on lines 100..107
      test/utils/course_utils.spec.js on lines 109..116
      test/utils/course_utils.spec.js on lines 118..125
      test/utils/course_utils.spec.js on lines 127..134
      test/utils/course_utils.spec.js on lines 136..143
      test/utils/course_utils.spec.js on lines 154..161
      test/utils/course_utils.spec.js on lines 163..170
      test/utils/course_utils.spec.js on lines 172..179
      test/utils/course_utils.spec.js on lines 181..188
      test/utils/course_utils.spec.js on lines 190..197
      test/utils/course_utils.spec.js on lines 199..206
      test/utils/course_utils.spec.js on lines 208..215
      test/utils/course_utils.spec.js on lines 217..224

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

      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

        test('correctly parses wikipedia redlinks (variation: Old version of page)', () => {
          const input = 'https://en.wikipedia.org/w/index.php?title=Smedsb%C3%B6le_Radio_Mast&oldid=479392613';
          const output = courseUtils.articleFromTitleInput(input);
          expect(output.title).toBe('Smedsböle Radio Mast');
          expect(output.project).toBe('wikipedia');
      Severity: Major
      Found in test/utils/course_utils.spec.js and 13 other locations - About 3 hrs to fix
      test/utils/course_utils.spec.js on lines 100..107
      test/utils/course_utils.spec.js on lines 109..116
      test/utils/course_utils.spec.js on lines 118..125
      test/utils/course_utils.spec.js on lines 127..134
      test/utils/course_utils.spec.js on lines 136..143
      test/utils/course_utils.spec.js on lines 145..152
      test/utils/course_utils.spec.js on lines 154..161
      test/utils/course_utils.spec.js on lines 163..170
      test/utils/course_utils.spec.js on lines 181..188
      test/utils/course_utils.spec.js on lines 190..197
      test/utils/course_utils.spec.js on lines 199..206
      test/utils/course_utils.spec.js on lines 208..215
      test/utils/course_utils.spec.js on lines 217..224

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

      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