sanger/limber

View on GitHub
app/models/utility/normalised_binning_calculator.rb

Summary

Maintainability
A
1 hr
Test Coverage
A
100%

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

    def build_transfers_hash(bins, number_of_rows, compression_reqd) # rubocop:todo Metrics/AbcSize
      binner = Binner.new(compression_reqd, number_of_rows)
      bins
        .values
        .each_with_object({})
Severity: Minor
Found in app/models/utility/normalised_binning_calculator.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 concentration_bins has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def concentration_bins(norm_details)
      # Returns eg. { 1 => [], 2 => [], 3 => [] }
      conc_bins = (1..number_of_bins).index_with { |_bin_number| [] }
      norm_details.each do |well_locn, details|
        amount = details['amount_in_target']
Severity: Minor
Found in app/models/utility/normalised_binning_calculator.rb - About 25 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