SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,581 of 12,581 total issues

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

  def remaining_taxa
    h = {}
    language = language_id.blank? ? nil : language_id.to_i

    row_hash.each do |r_key, r_value|
Severity: Minor
Found in lib/tools/interactive_key.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 dwc_extensions.rb has 445 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module CollectionObject::DwcExtensions

  extend ActiveSupport::Concern

  include CollectionObject::DwcExtensions::TaxonworksExtensions
Severity: Minor
Found in app/models/collection_object/dwc_extensions.rb - About 6 hrs to fix

    Class CollectionObjectsController has 48 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class CollectionObjectsController < ApplicationController
      include DataControllerConfiguration::ProjectDataControllerConfiguration
    
      before_action :set_collection_object, only: [
        :show, :edit, :update, :destroy, :navigation, :containerize,
    Severity: Minor
    Found in app/controllers/collection_objects_controller.rb - About 6 hrs to fix

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

      const MutationNames = {
        AddAttribution: 'addAttribution',
        AddCitation: 'addCitation',
        AddDataAttribute: 'addDataAtributte',
        AddDepiction: 'addDepiction',
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/mutations.js on lines 34..67

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

      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

      const MutationNames = {
        AddObservation: 'addObservation',
        CleanObservation: 'cleanObservation',
        CountdownStartedFor: 'countdownStartedFor',
        RemoveObservation: 'removeObservation',
      app/javascript/vue/tasks/images/new_image/store/mutations/mutations.js on lines 34..67

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

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

      export default function (state, args) {
        const {
          rowObjectId,
          rowObjectType,
          observationId,
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setDayFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setMonthFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMaxFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMedian.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardDeviation.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardError.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardMean.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleUnitFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setTimeFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setYearFor.js on lines 4..20

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

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

      export default function (state, args) {
        const {
          rowObjectId,
          rowObjectType,
          observationId,
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setDayFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setMonthFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMaxFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMedian.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleNFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardDeviation.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardError.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardMean.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleUnitFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setTimeFor.js on lines 4..20

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

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

      export default function (state, args) {
        const {
          rowObjectId,
          rowObjectType,
          observationId,
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setDayFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setMonthFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMaxFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMedian.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleNFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardError.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardMean.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleUnitFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setTimeFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setYearFor.js on lines 4..20

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

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

      export default function (state, args) {
        const {
          rowObjectId,
          rowObjectType,
          observationId,
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setMonthFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMaxFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMedian.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleNFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardDeviation.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardError.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardMean.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleUnitFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setTimeFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setYearFor.js on lines 4..20

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

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

      export default function (state, args) {
        const {
          rowObjectId,
          rowObjectType,
          observationId,
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setDayFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMaxFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMedian.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleNFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardDeviation.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardError.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardMean.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleUnitFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setTimeFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setYearFor.js on lines 4..20

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

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

      export default function (state, args) {
        const {
          rowObjectId,
          rowObjectType,
          observationId,
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setDayFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setMonthFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMaxFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMedian.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleNFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardDeviation.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardMean.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleUnitFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setTimeFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setYearFor.js on lines 4..20

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

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

      export default function (state, args) {
        const {
          rowObjectId,
          rowObjectType,
          observationId,
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setDayFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setMonthFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMaxFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMedian.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleNFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardDeviation.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardError.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleUnitFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setTimeFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setYearFor.js on lines 4..20

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

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

      export default function (state, args) {
        const {
          rowObjectId,
          rowObjectType,
          observationId,
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setDayFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setMonthFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMaxFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMedian.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleNFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardDeviation.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardError.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardMean.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setTimeFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setYearFor.js on lines 4..20

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

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

      export default function (state, args) {
        const {
          rowObjectId,
          rowObjectType,
          observationId,
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setDayFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setMonthFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMaxFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleNFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardDeviation.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardError.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardMean.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleUnitFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setTimeFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setYearFor.js on lines 4..20

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

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

      export default function (state, args) {
        const {
          rowObjectId,
          rowObjectType,
          observationId,
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setDayFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setMonthFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMedian.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleNFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardDeviation.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardError.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardMean.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleUnitFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setTimeFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setYearFor.js on lines 4..20

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

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

      export default function (state, args) {
        const {
          rowObjectId,
          rowObjectType,
          observationId,
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setDayFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setMonthFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMaxFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleMedian.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleNFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardDeviation.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardError.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleStandardMean.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setSampleUnitFor.js on lines 4..20
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setYearFor.js on lines 4..20

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

      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 date_regex_from_verbatim_label has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
      Open

        def self.date_regex_from_verbatim_label(text)
          return nil if text.blank?
          text = ' ' + text.downcase.squish + ' '
      
          date = {}
      Severity: Minor
      Found in lib/utilities/dates.rb - About 6 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

      File interactive_key.rb has 439 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      class Tools::InteractiveKey
      
        ##### FILTER PARAMETERS #####
      
        # @!observation_matrix_id
      Severity: Minor
      Found in lib/tools/interactive_key.rb - About 6 hrs to fix

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

        const GetterFunctions = {
          [GetterNames.GetCollectingEvent]: getCollectingEvent,
          [GetterNames.GetCollectionObject]: getCollectionObject,
          [GetterNames.GetContainer]: getContainer,
          [GetterNames.GetDepictions]: getDepictions,
        app/javascript/vue/tasks/type_specimens/store/getters/getters.js on lines 40..58

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 161.

        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