sanger/limber

View on GitHub

Showing 87 of 187 total issues

Method compute_well_amounts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def compute_well_amounts(wells, multiplication_factor)
      # sort on well coordinate to ensure wells are in plate column order
      wells
        .sort_by(&:coordinate)
        .each_with_object({}) do |well, well_amounts|
Severity: Minor
Found in app/models/utility/concentration_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

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

  def initialize(params = {})
    @user_uuid = params.fetch(:user_uuid, nil)
    @user = Sequencescape::Api::V2::User.find(uuid: @user_uuid).first unless @user_uuid.nil?
    @barcode = params.fetch(:barcode, nil)
    if barcode.present?
Severity: Minor
Found in app/models/labware_metadata.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

Method tubes_must_be_of_expected_purpose_type has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def tubes_must_be_of_expected_purpose_type
      return unless file_valid?

      parent_tubes.each do |foreign_barcode, tube_in_db|
        # NB. should be catching missing tubes in previous validation
Severity: Minor
Found in app/models/labware_creators/multi_stamp_tubes_using_tube_rack_scan.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

Method child_labware_of_plate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def child_labware_of_plate
      labware
        .wells
        .sort_by(&well_order)
        .each_with_object([]) do |well, plates|
Severity: Minor
Found in app/models/robots/bed/splitting.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

Function checkQCableWalkingBy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const checkQCableWalkingBy = (allowedWalkingByList) => {
  return (qcable) => {
    if (!qcable.lot || !qcable.lot.tag_layout_template || !qcable.lot.tag_layout_template.walking_by) {
      return {
        valid: false,
Severity: Minor
Found in app/frontend/javascript/shared/components/plateScanValidators.js - 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

Function checkForUnacceptablePlatePurpose has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const checkForUnacceptablePlatePurpose = (acceptable_purposes) => {
  return (plate) => {
    if (!acceptable_purposes || acceptable_purposes.length == 0) {
      // return valid if no acceptable purposes are provided
      return validScanMessage()
Severity: Minor
Found in app/frontend/javascript/shared/components/plateScanValidators.js - 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

Method stock_barcodes_by_quadrant has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def stock_barcodes_by_quadrant
      quadrants = {}
      source_plates_by_quadrant.each_with_index do |uuid, index|
        next if uuid.nil?

Severity: Minor
Found in app/models/labware_creators/quadrant_stamp_base.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

Severity
Category
Status
Source
Language