SpeciesFileGroup/taxonworks

View on GitHub

Showing 925 of 12,579 total issues

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

    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.

        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

          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

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

              def set_cached_names_for_taxon_names
                begin
                  TaxonName.transaction_with_retry do
                    t = taxon_name
            
            

            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.

            Function useFieldSync has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
            Open

            export function useFieldSync() {
              const attributes = ref([])
              const dataAttributes = ref([])
              const from = ref()
              const isLoading = ref(false)

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

              def self.extract_dates(trial, match_data)
                end_date_year, end_date_month, end_date_day = 0, 0, 0
                case trial[:method].downcase.to_sym
                  when :month_dd_yyyy_2
                    start_date_year = 3
            Severity: Major
            Found in lib/utilities/dates.rb - About 7 hrs to fix

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

                def nexml_descriptors(options = {})
                  opt = {target: ''}.merge!(options)
                  xml = Builder::XmlMarkup.new(target: opt[:target])
                  m = opt[:observation_matrix]
                  # Multistate characters

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

                  def build_da_for_otus
                    @total_data_lines = 0
                    i = 0
                    import_klass = type_select.start_with?('im')
                    att_klass = (type_select.capitalize + 'Attribute').safe_constantize

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

                def nexml_otus(options = {})
                  opt = {target: ''}.merge!(options)
                  xml = Builder::XmlMarkup.new(target: opt[:target])
                  m = opt[:observation_matrix]
              
              
              Severity: Minor
              Found in app/helpers/observation_matrices/export/nexml_helper.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

              Method coordinates_regex_from_verbatim_label has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
              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 - 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

              Method useful_descriptors has 168 lines of code (exceeds 25 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: Major
              Found in lib/tools/interactive_key.rb - About 6 hrs to fix

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

                  def nexml_otus(options = {})
                    opt = {target: ''}.merge!(options)
                    xml = Builder::XmlMarkup.new(target: opt[:target])
                    m = opt[:observation_matrix]
                
                

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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language