Showing 740 of 12,582 total issues
Method descriptors_hash_initiate
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def descriptors_hash_initiate
h = {}
# Depictions is depictions with other attributes added
depictions = 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 nexml_helper.rb
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ObservationMatrices::Export::NexmlHelper
def nexml_descriptors(options = {})
opt = {target: ''}.merge!(options)
xml = Builder::XmlMarkup.new(target: opt[:target])
Method nexml_descriptors
has 72 lines of code (exceeds 25 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
Method build_da_for_otus
has 72 lines of code (exceeds 25 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
Class SledImage
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class SledImage < ApplicationRecord
include Housekeeping
include Shared::Tags
include Shared::Notes
include Shared::IsData
File filter.rb
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Queries
module Person
class Filter < Query::Filter
include Queries::Concerns::DataAttributes
Function mx_spinner
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.mx_spinner = function(action) {
if (!this.length) { return this; }
return this.each(function() {
var target = $(this);
var overlay = target.data('mx_spinner');
Method build_sequence_relationships
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def build_sequence_relationships
@total_data_lines = 0
i = 0
gene_descriptors = {}
gene_attributes = {}
- 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 20 (exceeds 5 allowed). Consider refactoring. 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
- 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 identifiers.rb
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Queries::Concerns::Identifiers
include Queries::Helpers
extend ActiveSupport::Concern
Function makeInitialState
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeInitialState () {
return {
taxon_name: {
id: undefined,
global_id: undefined,
Method nexml_otus
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def nexml_otus(options = {})
opt = {target: ''}.merge!(options)
xml = Builder::XmlMarkup.new(target: opt[:target])
m = opt[:observation_matrix]
Method remaining_taxa
has 68 lines of code (exceeds 25 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|
Function useStore
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useStore = () => {
const actions = {
requestTopics: async () => {
state.isLoading = true
Class ImagesController
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class ImagesController < ApplicationController
include DataControllerConfiguration::ProjectDataControllerConfiguration
after_action -> { set_pagination_headers(:images) }, only: [:index, :api_index, :api_image_inventory], if: :json_request?
before_action :set_image, only: [:show, :edit, :update, :destroy, :rotate, :regenerate_derivative]
File taxon_names_controller.rb
has 276 lines of code (exceeds 250 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?
Method add_original_combination
has 65 lines of code (exceeds 25 allowed). Consider refactoring. 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)
Function default
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export default function (state, observation) {
if (!observation.type) { throw `Observations must have a type!` }
if (Object.keys(ObservationTypes).findIndex(typeKey => ObservationTypes[typeKey] === observation.type) === -1) { throw `Observations must have a valid type! Given ${observation.type}` }
- 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 is_in_use?
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def is_in_use?(exclude = [], only = [])
if only.empty?
self.class.reflect_on_all_associations(:has_many).each do |r|
next if exclude.include?(r.name)
return true if self.send(r.name).count(:all) > 0
- 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 make_lat_long_matching_table
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. 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
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"