SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,628 of 12,628 total issues

Method history_in_taxon_name has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def history_in_taxon_name(t, c, i)
      if c
        a = history_author_year_tag(t)
        b = source_author_year_tag(c.source)

Severity: Minor
Found in app/helpers/taxon_names/catalog_helper.rb - About 35 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_texts has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def all_texts
    leads = Lead
      .select(:id, :text, :origin_label)
      .with_project_id(sessions_current_project_id)
      .order(:text)
Severity: Minor
Found in app/controllers/leads_controller.rb - About 35 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 preview_bibtex_batch_load has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def preview_bibtex_batch_load
    file = params.require(:file)
    redirect_to batch_load_sources_path, notice: 'No file has been selected.' and return if file.blank?
    file_ok, mimetype = Utilities::Files.recognized_batch_file_type?(file.tempfile)
    if !file_ok
Severity: Minor
Found in app/controllers/sources_controller.rb - About 35 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 local_identifiers_facet has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def local_identifiers_facet
    return nil if local_identifiers.nil?
    a = nil

    if local_identifiers
Severity: Minor
Found in lib/queries/concerns/identifiers.rb - About 35 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 classification_types has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def classification_types
        return [] if taxon_name_classification_set.empty?
        t = []

        taxon_name_classification_set.each do |i|
Severity: Minor
Found in lib/queries/taxon_name_classification/filter.rb - About 35 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 create_simple_batch_load has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def create_simple_batch_load
    if params[:file] && digested_cookie_exists?(params[:file].tempfile, :Simple_namespaces_md5)
      @result = BatchLoad::Import::Namespaces::SimpleInterpreter.new(**batch_params)
      if @result.create
        flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} namespaces were created."
Severity: Minor
Found in app/controllers/namespaces_controller.rb - About 35 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 index has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def index
    respond_to do |format|
      format.html {
        redirect_to hub_path, notice: 'You requested a papertrail for nothing.' and return if params[:object_type].blank?
        klass = whitelist_constantize(params.require(:object_type))
Severity: Minor
Found in app/controllers/papertrail_controller.rb - About 35 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 create_bibtex_batch_load has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def create_bibtex_batch_load
    file = params.require(:file)
    redirect_to batch_load_sources_path, notice: 'no file has been selected' and return if file.blank?
    sha256 = Digest::SHA256.file(file.tempfile)
    if cookies[:batch_sources_md5] == sha256.hexdigest
Severity: Minor
Found in app/controllers/sources_controller.rb - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

      def autocomplete
        queries = [
          autocomplete_exact_id,
          autocomplete_identifier_identifier_exact,
          autocomplete_identifier_cached_like,
Severity: Minor
Found in lib/queries/image/autocomplete.rb - About 35 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 global_identifiers_facet has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def global_identifiers_facet
    return nil if global_identifiers.nil?
    a = nil

    if global_identifiers
Severity: Minor
Found in lib/queries/concerns/identifiers.rb - About 35 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 create_primers_batch_load has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def create_primers_batch_load
    if params[:file] && digested_cookie_exists?(params[:file].tempfile, :Primers_sequences_md5)
      @result = BatchLoad::Import::SequenceRelationships::PrimersInterpreter.new(**batch_params)
      if @result.create!
        flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} " \
Severity: Minor
Found in app/controllers/sequence_relationships_controller.rb - About 35 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 global_identifiers_facet has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def global_identifiers_facet
    return nil if global_identifiers.nil?
    a = nil

    if global_identifiers
Severity: Minor
Found in lib/queries/concerns/identifiers.rb - About 35 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 meta has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def meta
      return @meta if @meta

      @meta = Tempfile.new('meta.xml')

Severity: Minor
Found in lib/export/dwca/data.rb - About 35 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 term_facet has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def term_facet
        return nil if term.blank?
        w =  '%' + term.gsub(/\s+/, '%') + '%'

        if term_exact
Severity: Minor
Found in lib/queries/descriptor/filter.rb - About 35 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 duplicate_with_locks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def duplicate_with_locks
      n = QuickVerbatimResponse.new(form_params)
      # nullify if not locked
      #
      n.repository = nil if !locked?('repository')
Severity: Minor
Found in lib/material.rb - About 35 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 result_message has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def result_message
      case fixed
      when :fix_not_triggered
        'fix available, but not triggered'
      when :no_fix_available
Severity: Minor
Found in lib/soft_validation/soft_validation.rb - About 35 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 build_sequences has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def build_sequences
      @total_data_lines = 0;

      sequences = {}
      sequence_values = {}
Severity: Minor
Found in lib/batch_load/import/sequences/primers_interpreter.rb - About 35 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 is_unambiguous? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def is_unambiguous?
        RANKS.each do |r|
          if !send(r).nil?
            return false unless !send(r).nil? && !unambiguous_at?(r).nil?
          end
Severity: Minor
Found in lib/vendor/biodiversity.rb - About 35 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 probable_source_of_text has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def probable_source_of_text
        case score
        when 3..23
          if client.language == 'eng'
            'original text'
Severity: Minor
Found in lib/vendor/gnfinder/result.rb - About 35 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 disambiguate_combination has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def disambiguate_combination(target_protonym_ids = {})
        return nil unless target_protonym_ids.any?
        c = combination
        b = ambiguous_ranks

Severity: Minor
Found in lib/vendor/biodiversity.rb - About 35 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