Showing 927 of 12,584 total issues
Method validate_subject_and_object_ranks
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def validate_subject_and_object_ranks
tname = self.type_name
if tname =~ /TaxonNameRelationship::(Icnp|Icn|Iczn|Icvcn)/ && tname != 'TaxonNameRelationship::Iczn::Validating::UncertainPlacement'
rank_group = self.subject_taxon_name.rank_class.try(:parent)
- Read upRead up
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 nexml_descriptors
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def nexml_descriptors(options = {})
opt = {target: ''}.merge!(options)
xml = Builder::XmlMarkup.new(target: opt[:target])
m = opt[:observation_matrix]
# Multistate characters
- Read upRead up
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 generate
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def self.generate(otu, project_members, reference_csv = nil)
name_total = 0
::CSV.generate(col_sep: "\t") do |csv|
csv << %w{
ID
- Read upRead up
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 row_hash_initiate
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def row_hash_initiate
h = {}
rows = nil # Of either Otu or ObservationMatrixRow of type Otu !! TODO:
if observation_matrix_id.to_i == 0 && !otu_filter.blank?
- Read upRead up
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 ObservationMatricesController
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class ObservationMatricesController < ApplicationController
include DataControllerConfiguration::ProjectDataControllerConfiguration
before_action :set_observation_matrix, only: [
:show, :api_show, :edit, :update, :destroy,
Class CollectingEventsController
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class CollectingEventsController < ApplicationController
include DataControllerConfiguration::ProjectDataControllerConfiguration
before_action :set_collecting_event, only: [:show, :edit, :update, :destroy, :card, :clone, :navigation]
after_action -> { set_pagination_headers(:collecting_events) }, only: [:index, :api_index], if: :json_request?
Class TaxonNamesController
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class TaxonNamesController < ApplicationController
include DataControllerConfiguration::ProjectDataControllerConfiguration
before_action :set_taxon_name, only: [:show, :edit, :update, :destroy, :browse, :original_combination, :catalog, :api_show, :api_summary, :api_catalog]
after_action -> { set_pagination_headers(:taxon_names) }, only: [:index, :api_index], if: :json_request?
Class Filter
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class Filter < Query::Filter
include Queries::Concerns::DataAttributes
include Queries::Concerns::Notes
include Queries::Concerns::Tags
Method has too many lines. [46/25] Open
def make_lat_long_matching_table(*pieces, collection)
columns = ['CEID', 'Match', 'Verbatim Lat', 'Verbatim Long',
'Decimal lat', 'Decimal long', 'Is georeferenced?', 'Select']
thead = content_tag(:thead) do
- Read upRead up
- Exclude checks
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. [46/25] Open
def extract_params
params.require(:extract).permit(
:repository_id,
:verbatim_anatomical_origin,
:year_made,
- Read upRead up
- Exclude checks
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. [46/25] Open
def self.conform_significant(number, sig_digits)
input = significant_digits(number.to_s)
input_string = input[0]
intg = input[2]
decimal_point = input[3]
- Read upRead up
- Exclude checks
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 include_multistate_matrix
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def include_multistate_matrix(options = {})
opt = {target: '', descriptors: []}.merge!(options)
xml = Builder::XmlMarkup.new(target: opt[:target])
m = opt[:observation_matrix]
- Read upRead up
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 all_sub_headers
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def all_sub_headers(filtered = false)
unless filtered
ce_headers # generate the header structure (see CollectionObject.selected_column_names)
co_headers
bc_headers
- Read upRead up
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 data_for
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.data_for(collection_object)
o = collection_object
data = Catalog::CollectionObject::Entry.new(o)
data.items << Catalog::CollectionObject::EntryItem.new(type: :collected_on, object: o.collecting_event, start_date: o.collecting_event.start_date, end_date: o.collecting_event.end_date) if o.collecting_event_id.present?
Method has too many lines. [45/25] Open
def observations_set(query)
o = ::Observation.arel_table
# Descriptors on OTUs scored
f = 'descriptors_scored_for_otus'
- Read upRead up
- Exclude checks
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 otus_controller.rb
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
class OtusController < ApplicationController
include DataControllerConfiguration::ProjectDataControllerConfiguration
before_action :set_otu, only: [
:show, :edit, :update, :destroy, :collection_objects, :navigation,
Method sv_validate_name
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def sv_validate_name
correct_name_format = false
if rank_class
# TODO: name these Regexp somewhere
- Read upRead up
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 sv_potential_genus_homonyms
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def sv_potential_genus_homonyms
if persisted? && is_genus_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
- Read upRead up
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 create
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def create
@create_attempted = true
if ready_to_create?
# TODO: DRY
- Read upRead up
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 significant_digits
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def self.significant_digits(number_string)
# is there a decimal point?
intg = ''
decimal_point_zeros = ''
mantissa = ''
- Read upRead up
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"