Blahah/transrate

View on GitHub
lib/transrate/assembly.rb

Summary

Maintainability
C
1 day
Test Coverage

Method basic_bin_stats has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def basic_bin_stats bin

      # cumulative length is a float so we can divide it
      # accurately later to get the mean length
      cumulative_length = 0.0
Severity: Minor
Found in lib/transrate/assembly.rb - About 2 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 basic_bin_stats has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def basic_bin_stats bin

      # cumulative length is a float so we can divide it
      # accurately later to get the mean length
      cumulative_length = 0.0
Severity: Minor
Found in lib/transrate/assembly.rb - About 1 hr to fix

    Method initialize has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def initialize file
          @file = File.expand_path file
          unless File.exist? @file
            raise TransrateIOError.new "Assembly file doesn't exist: #{@file}"
          end
    Severity: Minor
    Found in lib/transrate/assembly.rb - About 1 hr to fix

      Method classify_contigs has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def classify_contigs cutoff
            # create hash of file handles for each output
            base = File.basename @file
            files = {}
            %w(good bad).each do |type|
      Severity: Minor
      Found in lib/transrate/assembly.rb - About 1 hr to fix

        Method initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def initialize file
              @file = File.expand_path file
              unless File.exist? @file
                raise TransrateIOError.new "Assembly file doesn't exist: #{@file}"
              end
        Severity: Minor
        Found in lib/transrate/assembly.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 classify_contigs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def classify_contigs cutoff
              # create hash of file handles for each output
              base = File.basename @file
              files = {}
              %w(good bad).each do |type|
        Severity: Minor
        Found in lib/transrate/assembly.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

        There are no issues that match your filters.

        Category
        Status