wurmlab/GeneValidator

View on GitHub
lib/genevalidator/output.rb

Summary

Maintainability
A
3 hrs
Test Coverage
A
97%

Method overview_hash has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def overview_hash(scores_from_json, quartiles, nee, no_mafft, no_internet,
                        map_errors, run_time, insufficient_BLAST_hits)
Severity: Major
Found in lib/genevalidator/output.rb - About 1 hr to fix

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

          def calculate_run_time(json_data)
            run_time = Hash.new(Pair1.new(0, 0))
            json_data.map do |row|
              row[:validations].each do |short_header, v|
                next if v[:run_time].nil? || v[:run_time].zero?
    Severity: Minor
    Found in lib/genevalidator/output.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 general_overview has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

          def general_overview(o)
            good_pred = o[:good_scores] == 1 ? 'One' : "#{o[:good_scores]} are"
            bad_pred  = o[:bad_scores] == 1 ? 'One' : "#{o[:bad_scores]} are"
    
            plural = 'prediction was' if o[:insufficient_BLAST_hits] == 1
    Severity: Minor
    Found in lib/genevalidator/output.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 create_validation_hash has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def create_validation_hash(row)
          row[:validations] = {}
          @validations.each do |item|
            val     = add_basic_validation_info(item)
            explain = add_explanation_data(item) if item.color != 'warning'
    Severity: Minor
    Found in lib/genevalidator/output.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

    There are no issues that match your filters.

    Category
    Status