SpeciesFileGroup/taxonworks

View on GitHub

Showing 918 of 12,572 total issues

File csl_styles.rb has 2212 lines of code (exceeds 250 allowed). Consider refactoring.
Open

CSL_STYLES = {
"http://www.zotero.org/styles/vancouver-brackets-only-year-no-issue" => "Vancouver (brackets, only year in date, no issue numbers)",
"http://www.zotero.org/styles/physiologia-plantarum" => "Physiologia Plantarum",
"http://www.zotero.org/styles/orthopedic-clinics-of-north-america" => "Orthopedic Clinics of North America",
"http://www.zotero.org/styles/asa-cssa-sssa" => "American Society of Agronomy, Crop Science Society of America, Soil Science Society of America",
Severity: Major
Found in config/initializers/constants/_controlled_vocabularies/csl_styles.rb - About 6 days to fix

    Method useful_descriptors has a Cognitive Complexity of 197 (exceeds 5 allowed). Consider refactoring.
    Open

      def useful_descriptors
        list_of_remaining_taxa = {}
        language = language_id.blank? ? nil : language_id.to_i
        row_hash.each do |r_key, r_value|
          if r_value[:status] != 'eliminated'
    Severity: Minor
    Found in lib/tools/interactive_key.rb - About 4 days 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 soft_validation_extensions.rb has 1461 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Protonym::SoftValidationExtensions
    
      module Klass
        VALIDATIONS = {
          sv_validate_name: {
    Severity: Major
    Found in app/models/protonym/soft_validation_extensions.rb - About 3 days to fix

      File dwcTerms.js has 997 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      export default [
        {
          name: 'type',
          qualName: 'http://purl.org/dc/terms/type',
          description: 'The nature or genre of the resource. For Darwin Core, recommended best practice is to use the name of the class that defines the root of the record.',
      Severity: Major
      Found in app/javascript/vue/tasks/dwca_import/const/dwcTerms.js - About 2 days to fix

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

                def invalid_relationship_remove_sf(project_id)
        
                  fixed = 0
                  combinations = 0
                  i = 0

        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. [168/25]
        Open

          def useful_descriptors
            list_of_remaining_taxa = {}
            language = language_id.blank? ? nil : language_id.to_i
            row_hash.each do |r_key, r_value|
              if r_value[:status] != 'eliminated'
        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 dates.rb has 797 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        module Utilities::Dates
        
          EARLIEST_DATE = '1700/01/10'.freeze # Reconcile with in-app
        
          LONG_MONTHS = %w{january february march april may june july august september october november december}.freeze
        Severity: Major
        Found in lib/utilities/dates.rb - About 1 day to fix

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

            def get_otu_contents(options = {})
              opt = {otus: []}.merge!(options)
              m = opt[:observation_matrix]
          
              otus = Otu.select('otus.*, observation_matrix_rows.id AS row_id').

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

            def get_otu_contents(options = {})
              opt = {otus: []}.merge!(options)
              m = opt[:observation_matrix]
          
              otus = Otu.select('otus.*, observation_matrix_rows.id AS row_id').
          Severity: Minor
          Found in app/helpers/observation_matrices/export/otu_contents_helper.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

          Function useGraph has 337 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function useGraph() {
            const state = reactive(initState())
          
            const nodes = computed(() =>
              Object.fromEntries(

            Method sv_potential_species_homonyms has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
            Open

                def sv_potential_species_homonyms
                  if persisted? && is_species_rank? && is_available?
                    if TaxonNameRelationship.where_subject_is_taxon_name(self).homonym_or_suppressed.empty?
                      if self.id == self.lowest_rank_coordinated_taxon.id
                        name1 = self.cached_primary_homonym ? self.cached_primary_homonym : nil
            Severity: Minor
            Found in app/models/protonym/soft_validation_extensions.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 has too many lines. [116/25]
            Open

                    def read_shape(filename, index)
                      # TODO: For some reason, Gis::FACTORY does not seem to be the default factory, so we are being specific here, to get the lenient polygon tests.  This gets us past the problem polygons, but does not actually deal with the problem.
                      # See http://dazuma.github.io/rgeo-shapefile/rdoc/RGeo/Shapefile/Reader.html for reader options.
            
                      # ne10 = RGeo::Shapefile::Reader.open('G:\Share\Downloads\PostgreSQL\PostGIS\10m_cultural\10m_cultural\ne_10m_admin_0_countries.shp', factory: Gis::FACTORY)

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

                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
                        Severity
                        Category
                        Status
                        Source
                        Language