SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,628 of 12,628 total issues

Method data_attribute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def data_attribute(columns, type = 'import')
      r = BatchLoad::ColumnResolver::Result.new

      predicate = columns['predicate']
      value = columns['value']
Severity: Minor
Found in lib/batch_load/column_resolver.rb - About 55 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 distance_in_meters has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def self.distance_in_meters(dist_in)
      dist_in   = '0.0 meters' if dist_in.blank?
      elevation = dist_in.strip.downcase
      pieces    = elevation.split(' ')
      # value     = elevation.to_f
Severity: Minor
Found in lib/utilities/geo.rb - About 55 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 aggregation has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def self.aggregation(objects, properties = nil)
    count  = 0
    result = {
      'type'     => 'Aggregation',
      'features' => []
Severity: Minor
Found in lib/gis/geo_json.rb - About 55 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 autocomplete has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def autocomplete
      t = Time.now
      return [] if query_string.blank?
      queries = [
        [autocomplete_exact_id, nil ],
Severity: Minor
Found in lib/queries/repository/autocomplete.rb - About 55 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 feature_collection has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def self.feature_collection(objects, properties = nil)
    count  = 0
    result = {
      'type'     => 'FeatureCollection',
      'features' => []
Severity: Minor
Found in lib/gis/geo_json.rb - About 55 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 entry_item_matches_target? has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def entry_item_matches_target?(item_object, reference_object)
      case item_object.class.to_s
      when 'Protonym'
        return item_object.id == reference_object.id
      when 'Combination'
Severity: Minor
Found in lib/catalog/nomenclature/entry.rb - About 55 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 process_exception_notification has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def self.process_exception_notification(settings)
    missing = EXCEPTION_NOTIFICATION_SETTINGS - settings.keys
    raise Error, "Missing #{missing} settings in exception_notification" unless missing.empty?

    invalid = settings.keys - EXCEPTION_NOTIFICATION_SETTINGS
Severity: Minor
Found in lib/settings.rb - About 55 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 resolves? has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def self.resolves?(text)
      responded = false
      if text =~ /^http(s)*:\/\/(.+)/ # http:// or  https://
        parsed = true
        uri    = URI.parse(text)
Severity: Minor
Found in lib/utilities/net.rb - About 55 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 2 locations. Consider refactoring.
Open

  def data
    s = ::Queries::CollectionObject::Filter.new(taxon_determinations: :false)
      .all

    @collection_objects = ::CollectionObject.select('buffered_determinations, count(buffered_determinations) count_buffered').where('buffered_determinations is not null')
app/controllers/tasks/collecting_events/stepwise/collectors_controller.rb on lines 9..22

Duplicated Code

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

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

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

Tuning

This issue has a mass of 45.

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 data
    s = ::Queries::CollectingEvent::Filter.new(collectors: :false)
                                          .all

    @collecting_events = ::CollectingEvent.select('verbatim_collectors, count(verbatim_collectors) count_collectors').where('verbatim_collectors is not null')
app/controllers/tasks/collection_objects/stepwise/determinations_controller.rb on lines 8..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 45.

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

const ComponentParse = {
  GeographicArea: 'GeographicArea',
  Georeferences: 'Georeferences',
  Dates: 'Dates',
  Elevation: 'Elevation',
app/javascript/vue/components/Form/FormCollectingEvent/const/components.js on lines 42..52
app/javascript/vue/tasks/citations/otus/store/getters/getters.js on lines 11..21
app/javascript/vue/tasks/collection_objects/browse/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/collection_objects/slide_breakdown/store/mutations/mutations.js on lines 11..21
app/javascript/vue/tasks/digitize/const/components.js on lines 54..64
app/javascript/vue/tasks/sources/new_source/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/type_specimens/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/uniquify/people/store/actions/actionNames.js on lines 1..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 53.

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

const ActionNames = {
  AddMatchPerson: 'addMatchPerson',
  AddSelectPerson: 'addSelectPerson',
  FindPeople: 'findPeople',
  FindMatchPeople: 'findMatchPeople',
app/javascript/vue/components/Form/FormCollectingEvent/const/components.js on lines 42..52
app/javascript/vue/tasks/citations/otus/store/getters/getters.js on lines 11..21
app/javascript/vue/tasks/collecting_events/new_collecting_event/const/components.js on lines 42..52
app/javascript/vue/tasks/collection_objects/browse/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/collection_objects/slide_breakdown/store/mutations/mutations.js on lines 11..21
app/javascript/vue/tasks/digitize/const/components.js on lines 54..64
app/javascript/vue/tasks/sources/new_source/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/type_specimens/store/actions/actionNames.js on lines 1..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 53.

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

const ActionNames = {
  LoadBiocurations: 'loadBiocurations',
  LoadCollectionObject: 'loadCollectionObject',
  LoadDepictions: 'loadDepictions',
  LoadDwc: 'loadDwc',
app/javascript/vue/components/Form/FormCollectingEvent/const/components.js on lines 42..52
app/javascript/vue/tasks/citations/otus/store/getters/getters.js on lines 11..21
app/javascript/vue/tasks/collecting_events/new_collecting_event/const/components.js on lines 42..52
app/javascript/vue/tasks/collection_objects/slide_breakdown/store/mutations/mutations.js on lines 11..21
app/javascript/vue/tasks/digitize/const/components.js on lines 54..64
app/javascript/vue/tasks/sources/new_source/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/type_specimens/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/uniquify/people/store/actions/actionNames.js on lines 1..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 53.

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

const MutationNames = {
  SetCollectionObject: 'setCollectionObject',
  SetIdentifier: 'setIdentifier',
  SetSledImage: 'setSledImage',
  SetImage: 'setImage',
app/javascript/vue/components/Form/FormCollectingEvent/const/components.js on lines 42..52
app/javascript/vue/tasks/citations/otus/store/getters/getters.js on lines 11..21
app/javascript/vue/tasks/collecting_events/new_collecting_event/const/components.js on lines 42..52
app/javascript/vue/tasks/collection_objects/browse/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/digitize/const/components.js on lines 54..64
app/javascript/vue/tasks/sources/new_source/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/type_specimens/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/uniquify/people/store/actions/actionNames.js on lines 1..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 53.

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

const ActionNames = {
  CloneSource: 'cloneSource',
  ConvertToBibtex: 'convertToBibtex',
  LoadSource: 'loadSource',
  LoadSoftValidations: 'loadSoftValidations',
app/javascript/vue/components/Form/FormCollectingEvent/const/components.js on lines 42..52
app/javascript/vue/tasks/citations/otus/store/getters/getters.js on lines 11..21
app/javascript/vue/tasks/collecting_events/new_collecting_event/const/components.js on lines 42..52
app/javascript/vue/tasks/collection_objects/browse/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/collection_objects/slide_breakdown/store/mutations/mutations.js on lines 11..21
app/javascript/vue/tasks/digitize/const/components.js on lines 54..64
app/javascript/vue/tasks/type_specimens/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/uniquify/people/store/actions/actionNames.js on lines 1..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 53.

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

const ComponentParse = {
  GeographicArea: 'GeographicArea',
  Georeferences: 'Georeferences',
  Dates: 'Dates',
  Elevation: 'Elevation',
Severity: Major
Found in app/javascript/vue/tasks/digitize/const/components.js and 8 other locations - About 55 mins to fix
app/javascript/vue/components/Form/FormCollectingEvent/const/components.js on lines 42..52
app/javascript/vue/tasks/citations/otus/store/getters/getters.js on lines 11..21
app/javascript/vue/tasks/collecting_events/new_collecting_event/const/components.js on lines 42..52
app/javascript/vue/tasks/collection_objects/browse/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/collection_objects/slide_breakdown/store/mutations/mutations.js on lines 11..21
app/javascript/vue/tasks/sources/new_source/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/type_specimens/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/uniquify/people/store/actions/actionNames.js on lines 1..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 53.

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

const ComponentParse = {
  GeographicArea: 'GeographicArea',
  Georeferences: 'Georeferences',
  Dates: 'Dates',
  Elevation: 'Elevation',
app/javascript/vue/tasks/citations/otus/store/getters/getters.js on lines 11..21
app/javascript/vue/tasks/collecting_events/new_collecting_event/const/components.js on lines 42..52
app/javascript/vue/tasks/collection_objects/browse/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/collection_objects/slide_breakdown/store/mutations/mutations.js on lines 11..21
app/javascript/vue/tasks/digitize/const/components.js on lines 54..64
app/javascript/vue/tasks/sources/new_source/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/type_specimens/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/uniquify/people/store/actions/actionNames.js on lines 1..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 53.

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

const ActionNames = {
  LoadTypeMaterial: 'loadTypeMaterial',
  LoadTypeMaterials: 'loadTypeMaterials',
  LoadTaxonName: 'loadTaxonName',
  LoadSoftValidations: 'loadSoftValidations',
app/javascript/vue/components/Form/FormCollectingEvent/const/components.js on lines 42..52
app/javascript/vue/tasks/citations/otus/store/getters/getters.js on lines 11..21
app/javascript/vue/tasks/collecting_events/new_collecting_event/const/components.js on lines 42..52
app/javascript/vue/tasks/collection_objects/browse/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/collection_objects/slide_breakdown/store/mutations/mutations.js on lines 11..21
app/javascript/vue/tasks/digitize/const/components.js on lines 54..64
app/javascript/vue/tasks/sources/new_source/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/uniquify/people/store/actions/actionNames.js on lines 1..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 53.

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

  const index = primitive
    ? arr.findIndex((item) => obj === item)
    : arr.findIndex((item) => obj[property] === item[property])
Severity: Minor
Found in app/javascript/vue/helpers/arrays.js and 1 other location - About 55 mins to fix
app/javascript/vue/helpers/arrays.js on lines 85..87

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

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

const GetterNames = {
  GetCitationSelected: 'getCitationSelected',
  GetCitationsList: 'getCitationsList',
  GetOtuCitationsList: 'getOtuCitationsList',
  GetOtuSelected: 'getOtuSelected',
app/javascript/vue/components/Form/FormCollectingEvent/const/components.js on lines 42..52
app/javascript/vue/tasks/collecting_events/new_collecting_event/const/components.js on lines 42..52
app/javascript/vue/tasks/collection_objects/browse/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/collection_objects/slide_breakdown/store/mutations/mutations.js on lines 11..21
app/javascript/vue/tasks/digitize/const/components.js on lines 54..64
app/javascript/vue/tasks/sources/new_source/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/type_specimens/store/actions/actionNames.js on lines 1..11
app/javascript/vue/tasks/uniquify/people/store/actions/actionNames.js on lines 1..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 53.

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