Showing 732 of 12,571 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",
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'
- 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 soft_validation_extensions.rb
has 1461 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Protonym::SoftValidationExtensions
module Klass
VALIDATIONS = {
sv_validate_name: {
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.',
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
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').
- 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 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
- 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 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'
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 = {}
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|
- 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 241 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function () {
let softValidations
function fillSoftValidation() {
if (!softValidations) {
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
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
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
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
# !!
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
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.
File data.rb
has 473 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'zip'
module Export::Dwca
# !!
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