WikiEducationFoundation/WikiEduDashboard

View on GitHub

Showing 1,672 of 1,672 total issues

Method perform has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def perform
    Course.current.each do |course|
      next unless course.flags[:salesforce_id]
      next unless course.approved?
      PushCourseToSalesforce.new(course)
Severity: Minor
Found in app/workers/daily_update/salesforce_sync_worker.rb - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function Footer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const Footer = ({
  article, colors, failureMessage, showArticleFinder, highlightedHtml, isWhocolorLang,
  whoColorFailed, users, unhighlightedContributors, revisionId, toggleRevisionHandler, pendingRequest
}) => {
  // Determine the Article Viewer Legend status based on what information

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function Quiz has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const Quiz = (props) => {
  const [selectedAnswerId, setSelectedAnswerId] = useState(null);

 const setAnswer = (e) => {
    return setSelectedAnswerId(e.currentTarget.getAttribute('data-answer-id'));
Severity: Minor
Found in app/assets/javascripts/training/components/quiz.jsx - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method calculate_week_meeting_dates has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def calculate_week_meeting_dates
    meetings = []
    @timeline_week_count.times do |wk|
      week_start = @beginning_of_first_week + wk.weeks
      # This excludes Sunday, putting the end of the week at Saturday.
Severity: Minor
Found in lib/course_meetings_manager.rb - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function getSlideInfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const getSlideInfo = (training, locale) => {
  let slideTitle;
  let assessment;
  let rawHtml;
  if (training.currentSlide.translations && training.currentSlide.translations[locale]) {
Severity: Minor
Found in app/assets/javascripts/training/components/training_slide_handler.jsx - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function TrainingModuleHandler has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const TrainingModuleHandler = (props) => {
  useEffect(() => {
    const moduleId = document.getElementById('react_root').getAttribute('data-module-id');
    props.fetchTrainingModule({ module_id: moduleId });
  }, []);
Severity: Minor
Found in app/assets/javascripts/training/components/training_module_handler.jsx - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method set_articles_edited has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def set_articles_edited
    @articles_edited = {}
    individual_courses.each do |course|
      individual_mainspace_edits(course).each do |edit|
        article_edits = @articles_edited[edit.article_id] || { new_article: false,
Severity: Minor
Found in app/presenters/individual_statistics_presenter.rb - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function SyllabusUpload has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const SyllabusUpload = ({ course }) => {
  const [isUploadingSyllabus, setIsUploadingSyllabus] = useState(false);
  const dispatch = useDispatch();

  const onDrop = (files) => {
Severity: Minor
Found in app/assets/javascripts/components/overview/syllabus-upload.jsx - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function YesNoSelector has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const YesNoSelector = (props) => {
    const initialState = props.course[props.courseProperty] ? I18n.t('application.opt_yes') : I18n.t('application.opt_no');
    const [selectedOption, setSelectedOption] = useState({ value: initialState, label: initialState });

  const _handleChange = (e) => {
Severity: Minor
Found in app/assets/javascripts/components/overview/yes_no_selector.jsx - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method index has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def index # rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
    @query = params[:search] if params[:search].present?
    @topic_slug = params[:topic] || DEFAULT_TOPIC unless @query || params[:all]
    @faqs = if @query
              log_to_sentry
Severity: Minor
Found in app/controllers/faq_controller.rb - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function Sidebar has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const Sidebar = ({ createdAt, currentUser, ticket }) => {
  const dispatch = useDispatch();
  const navigate = useNavigate();

  const notifyOwner = () => {
Severity: Minor
Found in app/assets/javascripts/components/tickets/sidebar.jsx - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

      <OverviewStat
        id="word-count"
        className="stat-display__value"
        stat={statistics.word_count}
        statMsg={I18n.t('metrics.word_count')}
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 30..36
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 46..52
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 54..60
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 61..67
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 10..16
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 17..23
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 24..30
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 45..51
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 52..58

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

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

      <OverviewStat
        id="campaign-words"
        className="stat-display__value"
        stat={campaign.word_count_human}
        statMsg={I18n.t('metrics.word_count')}
Severity: Major
Found in app/assets/javascripts/components/campaign/campaign_stats.jsx and 9 other locations - About 45 mins to fix
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 46..52
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 54..60
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 61..67
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 10..16
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 17..23
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 24..30
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 38..44
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 45..51
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 52..58

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

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

  updateCourseDates(valueKey, value) {
    const updatedCourse = CourseDateUtils.updateCourseDates(this.props.course, valueKey, value);
    return this.props.updateCourse(updatedCourse);
  },
Severity: Major
Found in app/assets/javascripts/components/wizard/form_panel.jsx and 2 other locations - About 45 mins to fix
app/assets/javascripts/components/overview/details.jsx on lines 92..95
app/assets/javascripts/components/timeline/meetings.jsx on lines 34..37

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

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

  updateCourseDates(valueKey, value) {
    const updatedCourse = CourseDateUtils.updateCourseDates(this.props.course, valueKey, value);
    return this.props.updateCourse(updatedCourse);
  },
Severity: Major
Found in app/assets/javascripts/components/overview/details.jsx and 2 other locations - About 45 mins to fix
app/assets/javascripts/components/timeline/meetings.jsx on lines 34..37
app/assets/javascripts/components/wizard/form_panel.jsx on lines 33..36

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

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

      <OverviewStat
        id="articles-created"
        className="stat-display__value"
        stat={statistics.new_count}
        statMsg={I18n.t('metrics.articles_created')}
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 30..36
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 46..52
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 54..60
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 61..67
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 17..23
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 24..30
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 38..44
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 45..51
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 52..58

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

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

      <OverviewStat
        id="campaign-edited"
        className="stat-display__value"
        stat={campaign.article_count_human}
        statMsg={I18n.t('metrics.articles_edited')}
Severity: Major
Found in app/assets/javascripts/components/campaign/campaign_stats.jsx and 9 other locations - About 45 mins to fix
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 30..36
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 46..52
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 61..67
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 10..16
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 17..23
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 24..30
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 38..44
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 45..51
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 52..58

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

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

      <OverviewStat
        id="articles-edited"
        className="stat-display__value"
        stat = {statistics.edited_count}
        statMsg={I18n.t('metrics.articles_edited')}
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 30..36
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 46..52
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 54..60
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 61..67
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 10..16
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 24..30
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 38..44
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 45..51
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 52..58

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

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

      <OverviewStat
        id="total-edits"
        className="stat-display__value"
        stat = {statistics.revision_count}
        statMsg={I18n.t('metrics.edit_count_description')}
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 30..36
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 46..52
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 54..60
app/assets/javascripts/components/campaign/campaign_stats.jsx on lines 61..67
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 10..16
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 17..23
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 38..44
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 45..51
app/assets/javascripts/components/common/OverviewStats/namespace_overview_stats.jsx on lines 52..58

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

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

      <header className="main-page">
        <div className="header">
          <h1 >{dashboardTitle}</h1>
        </div>
      </header>
Severity: Minor
Found in app/assets/javascripts/components/explore/explore.jsx and 1 other location - About 45 mins to fix
app/assets/javascripts/components/active_courses/active_courses_handler.jsx on lines 7..11

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

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