SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,577 of 12,577 total issues

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

export default function (state, args) {
  const {
    descriptorId,
    observationId,
    year
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setContinuousUnit.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setContinuousValue.js on lines 4..16
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setDayFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setMonthFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMaxFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMedian.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMinFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleNFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardDeviation.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardError.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardMean.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleUnitFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setTimeFor.js on lines 4..13

Duplicated Code

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

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

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

Tuning

This issue has a mass of 131.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

export default function (state, args) {
  const {
    descriptorId,
    continuousUnit,
    observationId
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setContinuousValue.js on lines 4..16
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setDayFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setMonthFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMaxFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMedian.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMinFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleNFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardDeviation.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardError.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardMean.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleUnitFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setTimeFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setYearFor.js on lines 4..13

Duplicated Code

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

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

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

Tuning

This issue has a mass of 131.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

export default function (state, args) {
  const {
    descriptorId,
    observationId,
    units
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setContinuousUnit.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setContinuousValue.js on lines 4..16
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setDayFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setMonthFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMaxFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMedian.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMinFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleNFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardDeviation.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardError.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardMean.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setTimeFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setYearFor.js on lines 4..13

Duplicated Code

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

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

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

Tuning

This issue has a mass of 131.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

export default function (state, args) {
  const {
    descriptorId,
    observationId,
    time
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setContinuousUnit.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setContinuousValue.js on lines 4..16
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setDayFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setMonthFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMaxFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMedian.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMinFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleNFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardDeviation.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardError.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardMean.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleUnitFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setYearFor.js on lines 4..13

Duplicated Code

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

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

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

Tuning

This issue has a mass of 131.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

export default function (state, args) {
  const {
    descriptorId,
    observationId,
    standardDeviation
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setContinuousUnit.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setContinuousValue.js on lines 4..16
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setDayFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setMonthFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMaxFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMedian.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMinFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleNFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardError.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardMean.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleUnitFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setTimeFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setYearFor.js on lines 4..13

Duplicated Code

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

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

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

Tuning

This issue has a mass of 131.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

export default function (state, args) {
  const {
    descriptorId,
    observationId,
    mean
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setContinuousUnit.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setContinuousValue.js on lines 4..16
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setDayFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setMonthFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMaxFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMedian.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMinFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleNFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardDeviation.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardError.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleUnitFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setTimeFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setYearFor.js on lines 4..13

Duplicated Code

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

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

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

Tuning

This issue has a mass of 131.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

export default function (state, args) {
  const {
    descriptorId,
    observationId,
    day
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setContinuousUnit.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setContinuousValue.js on lines 4..16
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setMonthFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMaxFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMedian.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleMinFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleNFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardDeviation.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardError.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleStandardMean.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setSampleUnitFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setTimeFor.js on lines 4..13
app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/mutations/setYearFor.js on lines 4..13

Duplicated Code

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

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

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

Tuning

This issue has a mass of 131.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function init has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

  init: function () {
    let softValidations

    function fillSoftValidation() {
      if (!softValidations) {
Severity: Minor
Found in app/assets/javascripts/views/tasks/nomenclature/browse.js - About 4 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 add_original_combination has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

  def self.add_original_combination(t, csv, origin_citation, name_remarks_vocab_id, project_members)
    e = t.original_combination_elements

    infraspecific_element = t.original_combination_infraspecific_element(e, remove_sic: true)

Severity: Minor
Found in lib/export/coldp/files/name.rb - About 4 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

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

    TaxonDetermination.createBatch(params).then((_) => {
      updateBufferedTable(state.selectedCOIds.length)
      state.collectionObjects = state.collectionObjects.filter(
        ({ id }) => !state.selectedCOIds.includes(id)
      )
app/javascript/vue/tasks/collecting_events/stepwise/collectors/composables/useStore.js on lines 61..72

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

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

    CollectingEvent.batchUpdate(params).then((_) => {
      updateVerbatimTable(state.selectedCEIds.length)
      state.collectingEvents = state.collectingEvents.filter(
        ({ id }) => !state.selectedCEIds.includes(id)
      )
app/javascript/vue/tasks/collection_objects/stepwise/determinations/composables/useStore.js on lines 54..65

Duplicated Code

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

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

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

Tuning

This issue has a mass of 130.

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

export function octagon({ color }, { size }) {
  const element = document.createElementNS(
    'http://www.w3.org/2000/svg',
    'polygon'
  )
Severity: Major
Found in app/javascript/vue/components/ui/VGraph/svg/octagon.js and 1 other location - About 4 hrs to fix
app/javascript/vue/components/ui/VGraph/svg/hexagon.js on lines 1..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 129.

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

export function hexagon({ color }, { size }) {
  const element = document.createElementNS(
    'http://www.w3.org/2000/svg',
    'polygon'
  )
Severity: Major
Found in app/javascript/vue/components/ui/VGraph/svg/hexagon.js and 1 other location - About 4 hrs to fix
app/javascript/vue/components/ui/VGraph/svg/octagon.js on lines 1..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 129.

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 has too many lines. [51/25]
Open

    def build
      v = object.valid_taxon_name
      base_names = v.historical_taxon_names

      base_names.each do |t|
Severity: Minor
Found in lib/catalog/nomenclature/entry.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.

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

  def row_hash_initiate
    h = {}
    rows = nil # Of either Otu or ObservationMatrixRow of type Otu !! TODO:
    if observation_matrix_id.to_i == 0 && !otu_filter.blank?

Severity: Minor
Found in lib/tools/image_matrix.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.

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

  loadVerbatimPage: (page = 1) => {
    const params = {
      ...state.verbatimParams,
      page
    }
app/javascript/vue/tasks/collection_objects/stepwise/determinations/composables/useStore.js on lines 68..84

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

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

  loadBufferedPage: (page = 1) => {
    const params = {
      ...state.bufferedParams,
      page
    }
app/javascript/vue/tasks/collecting_events/stepwise/collectors/composables/useStore.js on lines 75..91

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

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

Class Data has 35 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Data

    attr_accessor :data

    attr_accessor :eml
Severity: Minor
Found in lib/export/dwca/data.rb - About 4 hrs to fix

    Method sv_species_gender_agreement has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        def sv_species_gender_agreement
          if is_species_rank?
            s = part_of_speech_name
            if !s.nil? && is_available?
              if %w{adjective participle}.include?(s)
    Severity: Minor
    Found in app/models/protonym/soft_validation_extensions.rb - About 4 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

    Class TaxonNameClassification has 34 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class TaxonNameClassification < ApplicationRecord
      include Housekeeping
      include Shared::Citations
      include Shared::Notes
      include Shared::IsData
    Severity: Minor
    Found in app/models/taxon_name_classification.rb - About 4 hrs to fix
      Severity
      Category
      Status
      Source
      Language