Showing 87 of 187 total issues
Method primary_index
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def primary_index(row, column, scale, height, _width)
Function hasExpectedProperties
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const hasExpectedProperties = (expectedProperties) => {
return (results) => {
if (results.length === 0) {
return { valid: false, message: 'No results retrieved' }
}
- Read upRead up
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 7 (exceeds 5 allowed). Consider refactoring. Open
def child_labware_of_plate
labware
.wells
.sort_by(&well_order)
.each_with_object([]) do |well, plates|
- Read upRead up
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 validate_each
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_each(record, attribute, value)
Array(value).each do |nested|
next if nested.valid?
nested.errors.each do |error|
- Read upRead up
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 findResults
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const findResults = (cy, filter) => {
if (notResults !== undefined) {
notResults.restore()
}
- Read upRead up
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 check_for_invalid_characters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_for_invalid_characters
return if empty?
@row_data.each_with_index do |cell, i|
next if cell_is_blank?(cell)
- Read upRead up
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 validateParameters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const validateParameters = function (data) {
let result
if (!data) {
result = {
- Read upRead up
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 valid_robot
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def valid_robot
return false unless robot_present_if_required
return true unless verify_robot? && beds.values.first.labware.present?
- Read upRead up
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
Avoid too many return
statements within this method. Open
return includes.include?(current_state) if includes.present?
Method compute_well_amounts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def compute_well_amounts(wells)
# sort on well coordinate to ensure wells are in plate column order
wells
.sort_by(&:coordinate)
.each_with_object({}) do |well, well_amounts|
- Read upRead up
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 normalisation_details
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def normalisation_details(wells) # rubocop:todo Metrics/AbcSize
# sort on well coordinate to ensure wells are in plate column order
wells
.sort_by(&:coordinate)
.each_with_object({}) do |well, details|
- Read upRead up
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 check_for_unused_parents
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_for_unused_parents
parent_beds.each do |parent_bed|
next if beds[parent_bed].empty?
next if used_parents.include?(parent_bed)
- Read upRead up
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']
- Read upRead up
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 extract_pools_with_extra_details
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def extract_pools_with_extra_details
extra_details = Hash.new { |hash, pool_name| hash[pool_name] = { locations: [] } }
parent.wells_in_columns.each do |well|
next if well.empty?
- Read upRead up
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_have_active_requests_of_expected_type
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def tubes_must_have_active_requests_of_expected_type
return unless file_valid?
parent_tubes.each do |foreign_barcode, tube_in_db|
# NB. should be catching missing tubes in previous validation
- Read upRead up
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 compute_bin_details_by_well
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def compute_bin_details_by_well(well_amounts)
well_amounts.each_with_object({}) do |(well_locn, amount), well_colours|
bins_template.each do |bin_template|
next unless (bin_template['min']...bin_template['max']).cover?(amount)
- Read upRead up
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 requestsFromPlates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const requestsFromPlates = function (plateObjs) {
const requestsArray = []
for (let p = 0; p < plateObjs.length; p++) {
const plateObj = plateObjs[p]
const wells = plateObj.plate.wells
- Read upRead up
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(well_amounts) # rubocop:todo Metrics/AbcSize
# Returns eg. { 1 => [], 2 => [], 3 => [] }
conc_bins = (1..number_of_bins).index_with { |_bin_number| [] }
well_amounts.each do |well_locn, amount|
bins_template.each_with_index do |bin_template, bin_index|
- Read upRead up
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 print_to_pmb
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def print_to_pmb
# Ensure the template exists before attempting to print
label_template_id = pmb_label_template_id
return false if label_template_id.nil?
- Read upRead up
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 active_wells_with_terminated_requests
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def active_wells_with_terminated_requests(labware)
labware.wells.filter_map do |well|
next if well.inactive? || well.active_requests.empty?
well.location if well.active_requests.all?(&:failed?)
- Read upRead up
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"