SpeciesFileGroup/taxonworks

View on GitHub

Showing 925 of 12,579 total issues

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.

    Method bibtex_from_citproc has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

        def self.bibtex_from_citproc(c, b)
          return nil unless c.present? && b.present?
          c = JSON.parse(c)
    
          b[:address] = ::Utilities::Strings.encode_with_utf8(c['address']) unless c['address'].blank?
    Severity: Minor
    Found in lib/vendor/serrano.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 has too many lines. [64/25]
    Open

        def build_sequences
          @total_data_lines = 0;
    
          sequences = {}
          sequence_values = {}

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

      def self.generate(otus, project_members, root_otu_id = nil, reference_csv = nil, prefer_unlabelled_otus: true)
    
        # Until we have RC5 articulations we are simplifying handling the fact
        # that one taxon name can be used for many OTUs. Track to see that
        # an OTU with a given taxon name does not already exist
    Severity: Minor
    Found in lib/export/coldp/files/taxon.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 get_diffs has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

      def get_diffs version_new, version_old
        added_strings = []
        added_strings_indices = []
        deleted_strings = []
        deleted_strings_indices = []
    Severity: Minor
    Found in app/helpers/plugins/papertrail_helper.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 build_da_for_otus has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    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
    Severity: Minor
    Found in lib/batch_load/import/otus/data_attributes_interpreter.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

    Function useGraph has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
    Open

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

    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

    Class OtusController has 42 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class OtusController < ApplicationController
      include DataControllerConfiguration::ProjectDataControllerConfiguration
    
      before_action :set_otu, only: [
        :show, :edit, :update, :destroy, :collection_objects, :navigation,
    Severity: Minor
    Found in app/controllers/otus_controller.rb - About 5 hrs to fix

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

        def using_isbn_class
          unless identifier.nil?
            isbn = identifier.upcase
            # 'ISBN-13: 978-0-596-52068-7'
            isbn.gsub!('ISBN-10', '')

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

        def all_sub_headers(filtered = false)
          unless filtered
            ce_headers # generate the header structure (see CollectionObject.selected_column_names)
            co_headers
            bc_headers

      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 collection_objects_controller.rb has 401 lines of code (exceeds 250 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 5 hrs to fix

        Method get_otu_contents has 138 lines of code (exceeds 25 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: Major
        Found in app/helpers/observation_matrices/export/otu_contents_helper.rb - About 5 hrs to fix

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

          module Queries
          
            # Overview
            #
            # This class manages params and nesting of filter queries.
          Severity: Minor
          Found in lib/queries/query/filter.rb - About 5 hrs to fix

            File useFieldSync.js has 393 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { onBeforeMount, ref, computed, watch } from 'vue'
            import { Metadata, DataAttribute } from '@/routes/endpoints'
            import { DATA_ATTRIBUTE_INTERNAL_ATTRIBUTE } from '@/constants'
            import { QUERY_PARAMETER, PATTERN_TYPES } from '../constants'
            import {

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

                def data_models
                  allowed= %w{
                    AlternateValue
                    BiologicalAssociationsGraph
                    BiologicalRelationship

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

                init: function() {
                var
                    animationTime = 250;
              
                function showAll() {
              Severity: Major
              Found in app/assets/javascripts/views/shared/lists.js - About 5 hrs to fix

                File useGraph.js has 388 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { reactive, computed, toRefs } from 'vue'
                import {
                  BiologicalAssociation,
                  BiologicalAssociationGraph,
                  Citation

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

                    def self.gpx_to_csv(gpx_file, csv_options = {col_sep: "\t", headers: true, encoding: 'UTF-8', write_headers: true})
                      gpx_headers = %w(name geojson start_date end_date minimum_elevation maximum_elevation)
                  
                      csv_string = CSV.generate(**csv_options) do |csv|
                        csv << gpx_headers
                  Severity: Minor
                  Found in lib/vendor/gpx_to_csv.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.

                  Class Autocomplete has 39 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                    class Query::Autocomplete < Queries::Query
                  
                      include Arel::Nodes
                  
                      include Queries::Concerns::Identifiers
                  Severity: Minor
                  Found in lib/queries/query/autocomplete.rb - About 5 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language