SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,620 of 12,620 total issues

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

      $.get('similar_labels', params, function (local_data) {
        $("#match_count").text(local_data.count);
        $("#matching_span").html(local_data.table);
        $("#matched_start_date").val(start_date);
        $("#matched_end_date").val(end_date);
app/assets/javascripts/views/tasks/collecting_events/parse/dates/index.js on lines 112..118

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

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

export default function transformDepiction (depictionData) {
  const depiction = {
    caption: depictionData.caption,
    normalSrc: depictionData.image.image_file_url,
    mediumSrc: depictionData.image.alternatives.medium.image_file_url,
app/javascript/vue/tasks/observation_matrices/matrix_column_coder/helpers/transformDepictionForViewmodel.js on lines 3..14

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

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

const GetterFunctions = {
  [GetterNames.GetCELabel]: getCELabel,
  [GetterNames.GetCollectingEvent]: getCollectingEvent,
  [GetterNames.GetGeographicArea]: getGeographicArea,
  [GetterNames.GetGeoreferences]: getGeoreferences,
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/actions/actions.js on lines 15..28
app/javascript/vue/tasks/content/editor/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/dwca_import/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/loans/new/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/observation_matrices/image/store/getters/getters.js on lines 29..42
app/javascript/vue/tasks/observation_matrices/new/store/mutations/mutations.js on lines 29..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 116.

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

const MutationFunctions = {
  [MutationNames.SetCurrentVirtualPage]: setCurrentVirtualPage,
  [MutationNames.SetDataset]: setDataset,
  [MutationNames.SetPagination]: setPagination,
  [MutationNames.SetParamsFilter]: setParamsFilter,
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/actions/actions.js on lines 15..28
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/getters/getters.js on lines 29..42
app/javascript/vue/tasks/content/editor/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/loans/new/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/observation_matrices/image/store/getters/getters.js on lines 29..42
app/javascript/vue/tasks/observation_matrices/new/store/mutations/mutations.js on lines 29..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 116.

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

const MutationFunctions = {
  [MutationNames.AddLoanItem]: addLoanItem,
  [MutationNames.AddEditLoanItem]: addEditLoanItem,
  [MutationNames.CleanEditLoanItems]: cleanEditLoanItems,
  [MutationNames.SetLoan]: setLoan,
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/actions/actions.js on lines 15..28
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/getters/getters.js on lines 29..42
app/javascript/vue/tasks/content/editor/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/dwca_import/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/observation_matrices/image/store/getters/getters.js on lines 29..42
app/javascript/vue/tasks/observation_matrices/new/store/mutations/mutations.js on lines 29..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 116.

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

const GetterFunctions = {
  [GetterNames.GetMatrix]: getMatrix,
  [GetterNames.GetObservations]: getObservations,
  [GetterNames.GetObservationColumns]: getObservationColumns,
  [GetterNames.GetObservationLanguages]: getObservationLanguages,
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/actions/actions.js on lines 15..28
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/getters/getters.js on lines 29..42
app/javascript/vue/tasks/content/editor/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/dwca_import/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/loans/new/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/observation_matrices/new/store/mutations/mutations.js on lines 29..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 116.

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

const ActionFunctions = {
  [ActionNames.CloneCollectingEvent]: cloneCollectingEvent,
  [ActionNames.LoadCELabel]: loadCELabel,
  [ActionNames.LoadCollectingEvent]: loadCollectingEvent,
  [ActionNames.LoadIdentifier]: loadIdentifier,
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/getters/getters.js on lines 29..42
app/javascript/vue/tasks/content/editor/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/dwca_import/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/loans/new/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/observation_matrices/image/store/getters/getters.js on lines 29..42
app/javascript/vue/tasks/observation_matrices/new/store/mutations/mutations.js on lines 29..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 116.

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

const MutationFunctions = {
  [MutationNames.AddCitationToList]: addCitationToList,
  [MutationNames.AddDepictionToList]: addDepictionToList,
  [MutationNames.ChangeStateCitations]: changeStateCitations,
  [MutationNames.ChangeStateFigures]: changeStateFigures,
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/actions/actions.js on lines 15..28
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/getters/getters.js on lines 29..42
app/javascript/vue/tasks/dwca_import/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/loans/new/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/observation_matrices/image/store/getters/getters.js on lines 29..42
app/javascript/vue/tasks/observation_matrices/new/store/mutations/mutations.js on lines 29..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 116.

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

export default function transformDepiction (depictionData) {
  const depiction = {
    caption: depictionData.caption,
    normalSrc: depictionData.image.image_file_url,
    mediumSrc: depictionData.image.alternatives.medium.image_file_url,
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/helpers/transformDepictionForViewmodel.js on lines 3..14

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

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 (observation.type === ObservationTypes.FreeText) {
    existingObservation = observations.find(o => o.rowObjectId === observation.rowObjectId)
  } else if (observation.type === ObservationTypes.Qualitative) {
    existingObservation = observations.find(o => o.characterStateId === observation.characterStateId)
  } else {
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setObservation.js on lines 15..21

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

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 (observation.type === ObservationTypes.FreeText) {
    existingObservation = observations.find(o => o.descriptorId === observation.descriptorId)
  } else if (observation.type === ObservationTypes.Qualitative) {
    existingObservation = observations.find(o => o.characterStateId === observation.characterStateId)
  } else {
app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setObservation.js on lines 13..19

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

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

const MutationFunctions = {
  [MutationNames.SetMatrix]: setMatrix,
  [MutationNames.SetMatrixRows]: setMatrixRows,
  [MutationNames.SetMatrixColumns]: setMatrixColumns,
  [MutationNames.SetMatrixColumnsDynamic]: setMatrixColumnsDynamic,
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/actions/actions.js on lines 15..28
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/getters/getters.js on lines 29..42
app/javascript/vue/tasks/content/editor/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/dwca_import/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/loans/new/store/mutations/mutations.js on lines 29..42
app/javascript/vue/tasks/observation_matrices/image/store/getters/getters.js on lines 29..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 116.

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

      $.get('similar_labels', params, function (local_data) {
        $("#match_count").text(local_data.count);
        $("#matching_span").html(local_data.table);
        $("#matched_start_date").val(start_date);
        $("#matched_end_date").val(end_date);
app/assets/javascripts/views/tasks/collecting_events/parse/dates/index.js on lines 34..40

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 116.

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

Method populate_matrix_with_nexus has 101 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def populate_matrix_with_nexus(nexus_doc_id, parsed_nexus, matrix, options)
    nf = parsed_nexus
    m = matrix

    new_otus = []
Severity: Major
Found in app/helpers/lib/vendor/nexus_parser_helper.rb - About 4 hrs to fix

    Method data_for has 101 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def self.data_for(collection_object)
        o = collection_object
        data = Catalog::CollectionObject::Entry.new(o)
    
        data.items << Catalog::CollectionObject::EntryItem.new(type: :collected_on, object: o.collecting_event, start_date: o.collecting_event.start_date, end_date: o.collecting_event.end_date) if o.collecting_event_id.present?
    Severity: Major
    Found in lib/catalog/collection_object.rb - About 4 hrs to fix

      Method has too many lines. [45/25]
      Open

            def observations_set(query)
              o = ::Observation.arel_table
      
              # Descriptors on OTUs scored
              f = 'descriptors_scored_for_otus'
      Severity: Minor
      Found in lib/queries/taxon_name/tabular.rb by rubocop

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      File otus_controller.rb has 331 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      class OtusController < ApplicationController
        include DataControllerConfiguration::ProjectDataControllerConfiguration
      
        before_action :set_otu, only: [
          :show, :edit, :update, :destroy, :collection_objects, :navigation,
      Severity: Minor
      Found in app/controllers/otus_controller.rb - About 3 hrs to fix

        File filter.rb has 331 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        module Queries
          module CollectingEvent
            class Filter < Query::Filter
        
              # Params exists for all CollectingEvent attributes except these.
        Severity: Minor
        Found in lib/queries/collecting_event/filter.rb - About 3 hrs to fix

          Method sv_validate_name has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              def sv_validate_name
                correct_name_format = false
          
                if rank_class
                  # TODO: name these Regexp somewhere
          Severity: Minor
          Found in app/models/protonym/soft_validation_extensions.rb - About 3 hrs 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 sv_potential_genus_homonyms has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              def sv_potential_genus_homonyms
                if persisted? && is_genus_rank? && is_available?
                  if TaxonNameRelationship.where_subject_is_taxon_name(self).homonym_or_suppressed.empty?
                    if self.id == self.lowest_rank_coordinated_taxon.id
                      name1 = self.cached_primary_homonym ? self.cached_primary_homonym : nil
          Severity: Minor
          Found in app/models/protonym/soft_validation_extensions.rb - About 3 hrs 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

          Severity
          Category
          Status
          Source
          Language