Showing 714 of 12,929 total issues
File csl_styles.rb
has 2014 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/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",
"http://www.zotero.org/styles/acta-orthopaedica-belgica" => "Acta Orthopædica Belgica",
Method useful_descriptors
has a Cognitive Complexity of 207 (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'
- 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 merge_with
has a Cognitive Complexity of 153 (exceeds 5 allowed). Consider refactoring. Open
def merge_with(person_id)
return false if person_id == id
if r_person = Person.find(person_id) # get the person to merge to into self
begin
- 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
File taxon_name.rb
has 1018 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_dependency Rails.root.to_s + '/app/models/taxon_name_classification.rb'
require_dependency Rails.root.to_s + '/app/models/taxon_name_relationship.rb'
# A taxonomic name (nomenclature only). See also NOMEN.
#
Class TaxonName
has 127 methods (exceeds 20 allowed). Consider refactoring. 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)
File soft_validation_extensions.rb
has 981 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Protonym::SoftValidationExtensions
module Klass
VALIDATIONS = {
Method build_dwca
has a Cognitive Complexity of 113 (exceeds 5 allowed). Consider refactoring. Open
def build_dwca
line_counter = 1 # accounting for headers
tasks = triage(csv.headers, tasks_)
csv.each do |row|
- 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
File geographic_item.rb
has 768 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rgeo'
# A GeographicItem is one and only one of [point, line_string, polygon, multi_point, multi_line_string,
# multi_polygon, geometry_collection] which describes a position, path, or area on the globe, generally associated
# with a geographic_area (through a geographic_area_geographic_item entry), and sometimes only with a georeference.
File dates.rb
has 761 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
Class GeographicItem
has 90 methods (exceeds 20 allowed). Consider refactoring. Open
class GeographicItem < ApplicationRecord
include Housekeeping::Users
include Housekeeping::Timestamps
include Shared::IsData
include Shared::SharedAcrossProjects
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
- 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
File protonym.rb
has 709 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_dependency Rails.root.to_s + '/app/models/taxon_name_relationship.rb'
#
# Force the loading of TaxonNameRelationships in all worlds. This allows us to edit without restarting in development.
# Dir[Rails.root.to_s + '/app/models/taxon_name_relationship/**/*.rb'].sort.each {|file| require_dependency file }
#
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
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
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
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
- 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 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 = {}
Method generate
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
def self.generate(otu, reference_csv = nil)
CSV.generate(col_sep: "\t") do |csv|
csv << %w{
ID
basionymID
- 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
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) {
File data.rb
has 544 lines of code (exceeds 250 allowed). Consider refactoring. Open
concern :data_routes do |options|
collection do
get 'download'
get 'list'
post 'batch_create'