WikiEducationFoundation/WikiEduDashboard

View on GitHub

Showing 1,672 of 1,672 total issues

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

export const ExerciseButton = ({
  block_id, course, flags, isComplete, isExercise, slug,
  complete, fetchExercises, incomplete
}) => {
  let button = (
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/common/wiki_select.jsx on lines 13..117
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 2 locations. Consider refactoring.
Open

  if (tickets.sort.key && keys[tickets.sort.key]) {
    const order = (tickets.sort.sortKey) ? 'asc' : 'desc';
    keys[tickets.sort.key].order = order;
  }
Severity: Minor
Found in app/assets/javascripts/components/tickets/tickets_handler.jsx and 1 other location - About 40 mins to fix
app/assets/javascripts/components/article_finder/article_finder.jsx on lines 218..221

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

    if (props.sort.key) {
      const order = (props.sort.sortKey) ? 'asc' : 'desc';
      keys[props.sort.key].order = order;
    }
app/assets/javascripts/components/tickets/tickets_handler.jsx on lines 109..112

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

Function requestNewAccount has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  async requestNewAccount(passcode, courseSlug, username, email, createAccountNow) {
Severity: Minor
Found in app/assets/javascripts/utils/api.js - About 35 mins to fix

    Function link_open has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        md.renderer.rules.link_open = function (tokens, idx, options, env, self) {
    Severity: Minor
    Found in app/assets/javascripts/utils/markdown_it.js - About 35 mins to fix

      Function defaultRender has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          const defaultRender = md.renderer.rules.link_open || function (tokens, idx, options, env, self) {
      Severity: Minor
      Found in app/assets/javascripts/utils/markdown_it.js - About 35 mins to fix

        Function setValidation has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        const setValidation = function (key, valid, message, changed = true, state) {
        Severity: Minor
        Found in app/assets/javascripts/reducers/validations.js - About 35 mins to fix

          Method email has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def email(course, staffer, adder, new_instructor, courses_user)
          Severity: Minor
          Found in app/mailers/new_instructor_enrollment_mailer.rb - About 35 mins to fix

            Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def initialize(current, past, submitted, strictly_current, current_user)
            Severity: Minor
            Found in app/presenters/dashboard_presenter.rb - About 35 mins to fix

              Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def initialize(course, title, talk_title, assignments, templates)
              Severity: Minor
              Found in lib/wiki_assignment_output.rb - About 35 mins to fix

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

                  def create_alert(articles_course)
                    return if alert_already_exists?(articles_course)
                    first_revision = articles_course
                                     .course.revisions.where(article_id: articles_course.article_id).first
                    alert = Alert.create!(type: 'DYKNominationAlert',
                Severity: Minor
                Found in lib/alerts/dyk_nomination_monitor.rb and 1 other location - About 35 mins to fix
                lib/alerts/ga_nomination_monitor.rb on lines 51..60

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

                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

                  def create_alert(articles_course)
                    return if alert_already_exists?(articles_course)
                    first_revision = articles_course
                                     .course.revisions.where(article_id: articles_course.article_id).first
                    alert = Alert.create!(type: 'GANominationAlert',
                Severity: Minor
                Found in lib/alerts/ga_nomination_monitor.rb and 1 other location - About 35 mins to fix
                lib/alerts/dyk_nomination_monitor.rb on lines 55..65

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

                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

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

                  if (!response.ok) {
                    const data = await response.text();
                    return dispatch({ type: API_FAIL, data });
                  }
                Severity: Major
                Found in app/assets/javascripts/actions/course_actions.js and 3 other locations - About 35 mins to fix
                app/assets/javascripts/actions/course_actions.js on lines 160..163
                app/assets/javascripts/actions/course_actions.js on lines 173..176
                app/assets/javascripts/actions/course_actions.js on lines 186..189

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

                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

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

                  if (!response.ok) {
                    const data = await response.text();
                    return dispatch({ type: API_FAIL, data });
                  }
                Severity: Major
                Found in app/assets/javascripts/actions/course_actions.js and 3 other locations - About 35 mins to fix
                app/assets/javascripts/actions/course_actions.js on lines 173..176
                app/assets/javascripts/actions/course_actions.js on lines 186..189
                app/assets/javascripts/actions/course_actions.js on lines 197..200

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

                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

                AddAdminForm.propTypes = {
                  submittingNewAdmin: PropTypes.bool,
                  upgradeAdmin: PropTypes.func.isRequired,
                  handlePopoverClose: PropTypes.func.isRequired,
                };
                app/assets/javascripts/components/timeline/TrainingModules/ModuleRow/ModuleRow.jsx on lines 68..72
                app/assets/javascripts/components/wizard/summary_panel.jsx on lines 75..79

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

                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

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

                  if (!response.ok) {
                    const data = await response.text();
                    return dispatch({ type: API_FAIL, data });
                  }
                Severity: Major
                Found in app/assets/javascripts/actions/course_actions.js and 3 other locations - About 35 mins to fix
                app/assets/javascripts/actions/course_actions.js on lines 160..163
                app/assets/javascripts/actions/course_actions.js on lines 186..189
                app/assets/javascripts/actions/course_actions.js on lines 197..200

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

                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

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

                  if (!response.ok) {
                    const data = await response.text();
                    return dispatch({ type: API_FAIL, data });
                  }
                Severity: Major
                Found in app/assets/javascripts/actions/course_actions.js and 3 other locations - About 35 mins to fix
                app/assets/javascripts/actions/course_actions.js on lines 160..163
                app/assets/javascripts/actions/course_actions.js on lines 173..176
                app/assets/javascripts/actions/course_actions.js on lines 197..200

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

                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

                      <td>
                        <a href={reportUrl} target="_blank">{I18n.t('recent_activity.report')}</a>
                      </td>
                app/assets/javascripts/components/nav/hamburger_menu.jsx on lines 82..84
                app/assets/javascripts/components/nav/nav.jsx on lines 147..149

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

                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

                ModuleRow.propTypes = {
                  isStudent: PropTypes.bool,
                  module: PropTypes.object.isRequired,
                  trainingLibrarySlug: PropTypes.string.isRequired
                };
                app/assets/javascripts/components/settings/views/add_admin_form.jsx on lines 91..95
                app/assets/javascripts/components/wizard/summary_panel.jsx on lines 75..79

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

                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

                AvailableActions.propTypes = {
                  course: PropTypes.object.isRequired,
                  current_user: PropTypes.object.isRequired,
                  courseCreationNotice: PropTypes.string
                };
                app/assets/javascripts/components/overview/this_week.jsx on lines 104..108

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

                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