SpeciesFileGroup/taxonworks

View on GitHub

Showing 11,427 of 11,427 total issues

Class CollectingEvent has 79 methods (exceeds 20 allowed). Consider refactoring.
Open

class CollectingEvent < ApplicationRecord
  include Housekeeping
  include Shared::Citations
  include Shared::DataAttributes
  include Shared::HasRoles
Severity: Major
Found in app/models/collecting_event.rb - About 1 day to fix

    File collecting_event.rb has 657 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class CollectingEvent < ApplicationRecord
      include Housekeeping
      include Shared::Citations
      include Shared::DataAttributes
      include Shared::HasRoles
    Severity: Major
    Found in app/models/collecting_event.rb - About 1 day to fix

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

          def self.coordinates_regex_from_verbatim_label(text)
            return nil if text.blank?
            text = ' ' + text + ' '
            text.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.

      File dwca.rb has 632 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module BatchLoad
        # TODO: Originally transliterated from Import::CollectingEvents: Remove this to-do after successful operation.
        class Import::DWCA < BatchLoad::Import
      
          attr_accessor :collecting_events
      Severity: Major
      Found in lib/batch_load/import/dwca.rb - About 1 day to fix

        Method remaining_taxa has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
        Open

          def remaining_taxa
            #    @error_tolerance  - integer
            #    @eliminate_unknown  'true' or 'false'
            #    @descriptors_hash
        
        
        Severity: Minor
        Found in lib/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

        Method date_regex_from_verbatim_label has 261 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 + ' '
        
            date = {}
        Severity: Major
        Found in lib/utilities/dates.rb - About 1 day to fix

          Similar 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/nomenclature/new_taxon_name/store/actions/actions.js on lines 55..81

          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

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

          const ActionFunctions = {
            [ActionNames.LoadSoftValidation]: loadSoftValidation,
            [ActionNames.LoadTaxonName]: loadTaxonName,
            [ActionNames.LoadRanks]: loadRanks,
            [ActionNames.LoadStatus]: loadStatus,
          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

          Class has too many lines. [1021/1000]
          Open

          class TaxonName < ApplicationRecord
          
            # @return class
            #   this method calls Module#module_parent
            # TODO: This method can be placed elsewhere inside this class (or even removed if not used)
          Severity: Minor
          Found in app/models/taxon_name.rb by rubocop

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

          Function init has 234 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            init: function () {
              var soft_validations = undefined;
              function fillSoftValidation() {
                if (soft_validations == undefined) {
                  if ($('[data-global-id]').length) {
          Severity: Major
          Found in app/assets/javascripts/views/tasks/nomenclature/browse.js - About 1 day to fix

            File data.rb has 556 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

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

              class Protonym < TaxonName
              
                extend Protonym::SoftValidationExtensions::Klass
                include Protonym::SoftValidationExtensions::Instance
                include Protonym::Becomes
              Severity: Major
              Found in app/models/protonym.rb - About 1 day to fix

                Class TaxonNameRelationship has 57 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

                  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

                  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

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

                    def self.generate(otu, 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 taxon_name_relationship.rb has 493 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: Minor
                  Found in app/models/taxon_name_relationship.rb - About 7 hrs to fix

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

                    module Utilities
                      # Special general routines for Geo-specific itams
                      module Geo
                    =begin
                    To add a new (discovered) symbol:
                    Severity: Minor
                    Found in lib/utilities/geo.rb - About 7 hrs to fix

                      Method initialize has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def initialize(params)
                              @query_string = params[:query_term]
                      
                              @author = params[:author]
                              @author_ids = params[:author_ids] || []
                      Severity: Minor
                      Found in lib/queries/source/filter.rb - About 7 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

                      export default function ({ commit, state }, params = {}) {
                        return new Promise((resolve, reject) => {
                          state.settings.loadingRows = true
                          return GetMatrixObservationRows(state.matrix.id, Object.assign({}, params, state.configParams)).then(response => {
                            commit(MutationNames.SetMatrixRows, response.body)
                      app/javascript/vue/tasks/new_matrix/store/actions/loadColumnItems.js on lines 5..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 183.

                      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