Blahah/transrate

View on GitHub
lib/transrate/comparative_metrics.rb

Summary

Maintainability
C
1 day
Test Coverage

Method per_target_contig_reference_coverage has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    def per_target_contig_reference_coverage crbblast
      # each target sequence in the reference can have multiple query contigs
      # hit it. to calculate the reference coverage you can't just add up the
      # alignment lengths. you have to make sure that overlaps are taken into
      # account
Severity: Minor
Found in lib/transrate/comparative_metrics.rb - About 3 hrs 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 per_target_contig_reference_coverage has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def per_target_contig_reference_coverage crbblast
      # each target sequence in the reference can have multiple query contigs
      # hit it. to calculate the reference coverage you can't just add up the
      # alignment lengths. you have to make sure that overlaps are taken into
      # account
Severity: Major
Found in lib/transrate/comparative_metrics.rb - About 2 hrs to fix

    Method per_query_contig_reference_coverage has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def per_query_contig_reference_coverage
          # for each query contig in the @assembly find out how much it covers
          # the reference
          n_refs_with_recip = 0
          total_crbb_hits = 0
    Severity: Minor
    Found in lib/transrate/comparative_metrics.rb - About 1 hr 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 per_query_contig_reference_coverage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def per_query_contig_reference_coverage
          # for each query contig in the @assembly find out how much it covers
          # the reference
          n_refs_with_recip = 0
          total_crbb_hits = 0
    Severity: Minor
    Found in lib/transrate/comparative_metrics.rb - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status