SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,571 of 12,571 total issues

File data.rb has 678 lines of code (exceeds 250 allowed). Consider refactoring.
Open

concern :data_routes do |options|
  collection do
    get 'download'
    get 'list'
    post 'batch_create'
Severity: Major
Found in config/routes/data.rb - About 1 day to fix

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

        def self.coordinates_regex_from_verbatim_label(text)
          return nil if text.blank?
          text = text.gsub("''", '"')
            .gsub('´´', '"')
            .gsub('ʹʹ', '"')
    Severity: Minor
    Found in lib/utilities/geo.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 date_regex_from_verbatim_label has 266 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def self.date_regex_from_verbatim_label(text)
        return nil if text.blank?
        text = ' ' + text.downcase.squish + ' '
    
        date = {}
    Severity: Major
    Found in lib/utilities/dates.rb - About 1 day to fix

      Method remaining_taxa has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
      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 - About 1 day 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

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

      const VueComponents = {
        [ComponentVerbatim.Collectors]: Collectors,
        [ComponentVerbatim.DateComponent]: DateComponent,
        [ComponentVerbatim.Geolocation]: Geolocation,
        [ComponentVerbatim.Collectors]: Collectors,
      app/javascript/vue/components/Form/FormCollectingEvent/const/components.js on lines 60..86

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

      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 VueComponents = {
        [ComponentVerbatim.Collectors]: Collectors,
        [ComponentVerbatim.DateComponent]: DateComponent,
        [ComponentVerbatim.Geolocation]: Geolocation,
        [ComponentVerbatim.Collectors]: Collectors,
      app/javascript/vue/tasks/collecting_events/new_collecting_event/const/components.js on lines 60..86

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

      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 241 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        init: function () {
          let softValidations
      
          function fillSoftValidation() {
            if (!softValidations) {
      Severity: Major
      Found in app/assets/javascripts/views/tasks/nomenclature/browse.js - About 1 day to fix

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

        module Queries
          module BiologicalAssociation
        
            class Filter < Query::Filter
              include Queries::Concerns::Notes
        Severity: Major
        Found in lib/queries/biological_association/filter.rb - About 1 day to fix

          Class Filter has 64 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class Filter < Query::Filter
                include Queries::Concerns::Notes
                include Queries::Concerns::Tags
                include Queries::Concerns::Citations
                include Queries::Concerns::Depictions
          Severity: Major
          Found in lib/queries/biological_association/filter.rb - About 1 day to fix

            File tasks.rb has 554 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            scope :tasks do
              scope :leads do
                scope :hub, controller: 'tasks/leads/hub' do
                  get '/', action: :index, as: 'leads_hub_task'
                end
            Severity: Major
            Found in config/routes/tasks.rb - About 1 day to fix

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

                def self.generate(otu, project_members, reference_csv = nil)
                   name_total = 0
                  ::CSV.generate(col_sep: "\t") do |csv|
                    csv << %w{
                      ID
              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.

              File geo.rb has 533 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              module Utilities
                # Special general routines for Geo-specific itams
                module Geo
              
                  # !!
              Severity: Major
              Found in lib/utilities/geo.rb - About 1 day to fix

                Class TaxonNameRelationship has 60 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class TaxonNameRelationship < ApplicationRecord
                  include Housekeeping
                  include Shared::Citations
                  include Shared::Notes
                  include Shared::IsData
                Severity: Major
                Found in app/models/taxon_name_relationship.rb - About 1 day to fix

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

                      def model_graph(model, label: false)
                        m = model
                        k = node_klass(m.name)
                  
                        g = GraphViz.new(
                  Severity: Minor
                  Found in lib/tasks/docs/docs.rake 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 MutationFunctions = {
                    [MutationNames.SetTaxon]: setTaxon,
                    [MutationNames.SetType]: setType,
                    [MutationNames.SetBiologicalId]: setBiologicalId,
                    [MutationNames.SetCitation]: setCitation,
                  app/javascript/vue/tasks/images/new_image/store/getters/getters.js on lines 49..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 206.

                  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 GetterFunctions = {
                    [GetterNames.GetApplied]: getApplied,
                    [GetterNames.GetAttributions]: getAttributions,
                    [GetterNames.GetCitations]: getCitations,
                    [GetterNames.GetCollectionObject]: getCollectionObject,
                  app/javascript/vue/tasks/type_specimens/store/mutations/mutations.js on lines 50..73

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

                  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

                  File taxon_name_relationship.rb has 504 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require_dependency Rails.root.to_s + '/app/models/taxon_name_classification.rb'
                  
                  # A NOMEN https://github.com/SpeciesFileGroup/nomen relationship between two Protonyms.
                  #
                  # Unless otherwise noted relationships read left to right, and can be interpreted by inserting "of" after the class name.
                  Severity: Major
                  Found in app/models/taxon_name_relationship.rb - About 1 day to fix

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

                    export default function (state, id) {
                      var position = state.source_citations.findIndex(item => {
                        if (id === item.id) {
                          return true
                        }
                    app/javascript/vue/tasks/citations/otus/store/mutations/removeOtuFormCitationList.js on lines 1..18

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

                    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 default function (state, id) {
                      var position = state.otu_citations.findIndex(item => {
                        if (id === item.id) {
                          return true
                        }
                    app/javascript/vue/tasks/citations/otus/store/mutations/removeSourceFormCitationList.js on lines 1..18

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

                    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

                    File data.rb has 473 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    require 'zip'
                    
                    module Export::Dwca
                    
                      # !!
                    Severity: Minor
                    Found in lib/export/dwca/data.rb - About 7 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language