Showing 281 of 5,426 total issues
Class Batch
has 55 methods (exceeds 20 allowed). Consider refactoring. Open
class Batch < ApplicationRecord # rubocop:todo Metrics/ClassLength
include Api::BatchIO::Extensions
include Api::Messages::FlowcellIO::Extensions
include AASM
include SequencingQcBatch
Class Plate
has 51 methods (exceeds 20 allowed). Consider refactoring. Open
class Plate < Labware # rubocop:todo Metrics/ClassLength
include Api::PlateIO::Extensions
include ModelExtensions::Plate
include Transfer::Associations
include Transfer::State::PlateState
File batch.rb
has 416 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'timeout'
require 'aasm'
# A {Batch} groups 1 or more {Request requests} together to enable processing in a
# {Pipeline}. All requests in a batch get usually processed together, although it is
Class Request
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
class Request < ApplicationRecord # rubocop:todo Metrics/ClassLength
# Include
include ModelExtensions::Request
include Aliquot::DeprecatedBehaviours::Request
include Api::RequestIO::Extensions
File study.rb
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'aasm'
# A Study is a collection of various {Sample samples} and the work done on them.
# They are perhaps slightly overloaded, and provide:
# - A means of grouping together samples for administrative purposes
File request.rb
has 392 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'aasm'
# A Request represents work which needs to be done, either to fulfil a customers
# needs {CustomerRequest} or for internal reasons {SystemRequest}.
# The progress of a request is tracked through its {Request::Statemachine state machine}.
File sample.rb
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rexml/text'
#
# A {Sample} is an abstract concept, with represents the life of a sample of DNA/RNA
# as it moves through our processes. As a result, a sample may exist in multiple
Class Order
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class Order < ApplicationRecord # rubocop:todo Metrics/ClassLength
# Ensure order methods behave correctly
AssetTypeError = Class.new(StandardError)
DEFAULT_ASSET_INPUT_METHODS = ['select an asset group'].freeze
Class Map
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class Map < ApplicationRecord
validates :description, :asset_size, :location_id, :row_order, :column_order, :asset_shape, presence: true
validates :asset_size, :row_order, :column_order, numericality: true
# @!attribute description
Method create_request_chain!
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def create_request_chain!(request_type_and_multiplier_pairs, source_data_set, multiplexing_assets, &block) # rubocop:todo Metrics/CyclomaticComplexity
raise StandardError, 'No request types specified!' if request_type_and_multiplier_pairs.empty?
request_type, multiplier = request_type_and_multiplier_pairs.shift
- 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
Class BatchesController
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class BatchesController < ApplicationController # rubocop:todo Metrics/ClassLength
# WARNING! This filter bypasses security mechanisms in rails 4 and mimics rails 2 behaviour.
# It should be removed wherever possible and the correct Strong Parameter options applied in its place.
before_action :evil_parameter_hack!
Method login_required
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def login_required # rubocop:todo Metrics/CyclomaticComplexity
username, passwd = get_auth_data
if username && passwd
user = User.authenticate(username, passwd)
- 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 do_cherrypick_task
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def do_cherrypick_task(_task, params) # rubocop:todo Metrics/CyclomaticComplexity
plates = params[:plate]
size = params[:plate_size]
plate_type = params[:plate_type]
- 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
Class Study
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class Study < ApplicationRecord # rubocop:todo Metrics/ClassLength
# It has to be here, as there are has_many through: :roles associations in modules
# Includes / Extendes
has_many :roles
Method duplicate_barcodes
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def duplicate_barcodes # rubocop:todo Metrics/CyclomaticComplexity
return nil, nil unless upload.respond_to?(:rows)
unique_bcs = {}
unique_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
Class StudiesController
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class StudiesController < ApplicationController
# WARNING! This filter bypasses security mechanisms in rails 4 and mimics rails 2 behviour.
# It should be removed wherever possible and the correct Strong Parameter options applied in its place.
before_action :evil_parameter_hack!
include REXML
Class Row
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class Row # rubocop:todo Metrics/ClassLength
include ActiveModel::Model
include Converters
attr_accessor :number, :data, :columns, :cache
Class TestWorksheet
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class TestWorksheet < SequencescapeExcel::Worksheet::Base # rubocop:todo Metrics/ClassLength
include SequencescapeExcel::Helpers::Worksheet
self.worksheet_name = 'DNA Collections Form'
File bulk_submission.rb
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ArrayWithFieldList
refine Array do
def comma_separate_field_list_for_display(*fields)
field_list(*fields).join(', ')
end
File batches_controller.rb
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
class BatchesController < ApplicationController # rubocop:todo Metrics/ClassLength
# WARNING! This filter bypasses security mechanisms in rails 4 and mimics rails 2 behaviour.
# It should be removed wherever possible and the correct Strong Parameter options applied in its place.
before_action :evil_parameter_hack!