Showing 739 of 12,579 total issues
Avoid too many return
statements within this method. Open
return date
Avoid too many return
statements within this method. Open
return {} if coordinates[:lat_sec].to_f >= 60
Avoid too many return
statements within this method. Open
return c
Avoid too many return
statements within this method. Open
return {}
Function default
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function (observationData) {
if (observationData.type === ObservationTypes.Qualitative) {
return makeQualitativeObservation(observationData)
} else if (observationData.type === ObservationTypes.Continuous) {
return makeContinuousObservation(observationData)
- 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 perform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def perform(import_dataset, uuid, max_time, max_records)
begin
Current.user_id = import_dataset.created_by_id
Current.project_id = import_dataset.project_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 checkChildFilter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
CarrouselTask.prototype.checkChildFilter = function (childTag) {
let find = 0
let isTrue = 0
for (let key in this.filters) {
- 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 closeSlideoutPanel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
closeSlideoutPanel: function (panel) {
if ($(panel).hasClass('slide-left')) {
$(panel).css('right', '')
if ($(panel).css('left') == '0px') {
$(panel).attr('data-panel-open', 'false')
- 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 start
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
start () {
this.update()
this.intervalId = setInterval(() => {
if (!this.isPaused) {
- 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 togglePanel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
togglePanel (e) {
const element = e.target
if (element.classList.contains('slide-panel-circle-icon')) {
const panelElement = element.closest('.slide-panel')
- 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 addToArray
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function addToArray(arr, obj, opts = {}) {
const { property = 'id', prepend = false, primitive = false } = opts
const index = primitive
? arr.findIndex((item) => obj === item)
- 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 default
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function (observationData) {
if (observationData.type === ObservationTypes.Qualitative) {
return makeQualitativeObservation(observationData)
} else if (observationData.type === ObservationTypes.Continuous) {
return makeContinuousObservation(observationData)
- 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 useAnnotationHandlers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function useAnnotationHandlers(annotationLists) {
function handleRadialCreate({ item }) {
if (annotationLists[item.base_class]) {
addToArray(annotationLists[item.base_class].value, item)
- 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 annotators
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def annotators
known = ApplicationRecord.subclasses.select {|a| a.column_names.include?('project_id')}.map(&:name)
known.each do |k|
next if k.safe_constantize.table_name == 'test_classes' # TODO: a kludge to ignore stubbed classes in testing
- 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 member_syncronize_matrices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def member_syncronize_matrices
# TODO: refine to eliminate other possibilities
# Don't bother with the overhead if there are no matrices
if ObservationMatrix.where(project_id: project_id).any?
- 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_validate_coordinated_names_part_of_speech
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sv_validate_coordinated_names_part_of_speech
return true unless is_available?
return true unless is_species_rank?
list_of_coordinated_names.each do |t|
if self.part_of_speech_class != t.part_of_speech_class
- 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_validate_parent_rank
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sv_validate_parent_rank
if self.rank_class && self.id == self.cached_valid_taxon_name_id
if rank_string == 'NomenclaturalRank' || self.parent&.rank_string == 'NomenclaturalRank' || !!self.iczn_uncertain_placement_relationship
true
elsif !self.rank_class&.valid_parents.include?(self.parent&.rank_string)
- 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_validate_coordinated_names_type_species
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sv_validate_coordinated_names_type_species
return true unless is_valid?
return true unless is_genus_rank?
list_of_coordinated_names.each do |t|
if self.type_species != t.type_species
- 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_validate_coordinated_names_gender
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sv_validate_coordinated_names_gender
return true unless is_available?
return true unless is_genus_rank?
s = self.gender_class
list_of_coordinated_names.each do |t|
- 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 validate_number
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_number
t = self.collection_type.to_s
if self.number_of_collection_objects.nil? && self.number_of_containers.nil?
errors.add(:number_of_collection_objects, 'At least one number of specimens or number of containers should be specified')
errors.add(:number_of_containers, 'At least one number of specimens or number of containers should be specified')
- 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"