SpeciesFileGroup/taxonworks

View on GitHub

Showing 740 of 12,579 total issues

Method value_facet has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def value_facet
    return nil if data_attribute_exact_value.blank?  && data_attribute_wildcard_value.blank?

    a,b = nil, nil

Severity: Minor
Found in lib/queries/concerns/data_attributes.rb - About 55 mins to fix

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 save has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def save
      if collection_objects.size == 0
        errors = ActiveModel::Errors.new('base')
        errors.add(:total, 'No totals provided!')
        return false, errors
Severity: Minor
Found in lib/material.rb - About 55 mins to fix

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 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def all(nil_empty = false)

      # TODO: should turn off/on project_id here on nil empty?

      a = all_and_clauses
Severity: Minor
Found in lib/queries/query/filter.rb - About 55 mins to fix

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 feature_collection has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def self.feature_collection(objects, properties = nil)
    count  = 0
    result = {
      'type'     => 'FeatureCollection',
      'features' => []
Severity: Minor
Found in lib/gis/geo_json.rb - About 55 mins to fix

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 distance_in_meters has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def self.distance_in_meters(dist_in)
      dist_in   = '0.0 meters' if dist_in.blank?
      elevation = dist_in.strip.downcase
      pieces    = elevation.split(' ')
      # value     = elevation.to_f
Severity: Minor
Found in lib/utilities/geo.rb - About 55 mins to fix

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 resolves? has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def self.resolves?(text)
      responded = false
      if text =~ /^http(s)*:\/\/(.+)/ # http:// or  https://
        parsed = true
        uri    = URI.parse(text)
Severity: Minor
Found in lib/utilities/net.rb - About 55 mins to fix

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 autocomplete has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def autocomplete
      t = Time.now
      return [] if query_string.blank?
      queries = [
        [autocomplete_exact_id, nil ],
Severity: Minor
Found in lib/queries/repository/autocomplete.rb - About 55 mins to fix

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 aggregation has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def self.aggregation(objects, properties = nil)
    count  = 0
    result = {
      'type'     => 'Aggregation',
      'features' => []
Severity: Minor
Found in lib/gis/geo_json.rb - About 55 mins to fix

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 entry_item_matches_target? has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def entry_item_matches_target?(item_object, reference_object)
      case item_object.class.to_s
      when 'Protonym'
        return item_object.id == reference_object.id
      when 'Combination'
Severity: Minor
Found in lib/catalog/nomenclature/entry.rb - About 55 mins to fix

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 process_exception_notification has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def self.process_exception_notification(settings)
    missing = EXCEPTION_NOTIFICATION_SETTINGS - settings.keys
    raise Error, "Missing #{missing} settings in exception_notification" unless missing.empty?

    invalid = settings.keys - EXCEPTION_NOTIFICATION_SETTINGS
Severity: Minor
Found in lib/settings.rb - About 55 mins to fix

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 reset has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    reset() {
      const boardStore = useBoardStore()
      const tagStore = useTagStore()
      const noteStore = useNoteStore()
      const lock = useLockStore()

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 8 (exceeds 5 allowed). Consider refactoring.
Open

    CarrouselData.prototype.checkChildFilter = function(childTag) {
        var find = 0;
        var isTrue = 0;
        for (var key in this.filters) {
            if(this.filters[key] == true) {
Severity: Minor
Found in app/assets/javascripts/views/hub/cards-filter.js - About 45 mins to fix

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 filterKeys has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    CarrouselData.prototype.filterKeys = function(handleKey) {
        for(var i = 0; i <= this.children; i++) {            
            child = $('.data_section[data-section="' + this.sectionTag + '"] > .cards-section > .card-container:nth-child('+ (i) +')');
            if(this.checkChildFilter(child.children().children(".filter_data"))) {
                if($(child).text().toLowerCase().indexOf(handleKey.toLowerCase()) > 0 || handleKey == "") {
Severity: Minor
Found in app/assets/javascripts/views/hub/cards-filter.js - About 45 mins to fix

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 8 (exceeds 5 allowed). Consider refactoring.
Open

export default async function(id_or_couplet) {
  let lo = undefined
  let error_message = undefined
  if (typeof(id_or_couplet) == 'object') {
    lo = id_or_couplet
Severity: Minor
Found in app/javascript/vue/tasks/leads/new_lead/store/actions/loadKey.js - About 45 mins to fix

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_priority has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def sv_validate_priority
    if self.type_class.nomenclatural_priority == :direct
      date1 = self.subject_taxon_name.cached_nomenclature_date
      date2 = self.object_taxon_name.cached_nomenclature_date
      if !!date1 && !!date2 && date2 > date1 && subject_invalid_statuses.empty?
Severity: Minor
Found in app/models/taxon_name_relationship/iczn.rb - About 45 mins to fix

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_fix_coordinated_names_part_of_speech has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def sv_fix_coordinated_names_part_of_speech
      return false unless self.part_of_speech_class.nil?
      list_of_coordinated_names.each do |t|
        unless t.part_of_speech_class.nil?
          c = self.taxon_name_classifications.create(type: t.part_of_speech_class.to_s)
Severity: Minor
Found in app/models/protonym/soft_validation_extensions.rb - About 45 mins to fix

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_fix_coordinated_names_type_species has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def sv_fix_coordinated_names_type_species
      fixed = false
      tr = nil
      return false unless self.type_species.nil?
      list_of_coordinated_names.each do |t|
Severity: Minor
Found in app/models/protonym/soft_validation_extensions.rb - About 45 mins to fix

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_synonym_relationship has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def sv_synonym_relationship
    if self.source
      date1 = self.source.cached_nomenclature_date.to_time
      date2 = self.subject_taxon_name.cached_nomenclature_date
      if !!date1 && !!date2
Severity: Minor
Found in app/models/taxon_name_relationship/icn/unaccepting/synonym.rb - About 45 mins to fix

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_fix_coordinated_names_gender has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def sv_fix_coordinated_names_gender
      return false unless self.gender_class.nil?
      list_of_coordinated_names.each do |t|
        unless t.gender_class.nil?
          c = self.taxon_name_classifications.create(type: t.gender_class.to_s)
Severity: Minor
Found in app/models/protonym/soft_validation_extensions.rb - About 45 mins to fix

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_single_primary_type has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def sv_single_primary_type
    primary_types = TypeMaterial.with_type_array(['holotype', 'neotype', 'lectotype']).where_protonym(protonym).not_self(self)
    syntypes = TypeMaterial.with_type_array(['syntype', 'syntypes']).where_protonym(protonym)

    if type_type =~ /syntype/
Severity: Minor
Found in app/models/type_material.rb - About 45 mins to fix

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

Severity
Category
Status
Source
Language