Showing 281 of 5,426 total issues
Method prepare_order
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def prepare_order(details) # rubocop:todo Metrics/CyclomaticComplexity
# Retrieve common attributes
study = Study.find_by_id_or_name!(details['study id'], details['study name'])
project = Project.find_by_id_or_name!(details['project id'], details['project name'])
user = User.find_by(login: details['user login']) or
- 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
File plate.rb
has 320 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'lab_where_client'
# https://github.com/sanger/sequencescape/raw/master/docs/images/plate.jpg
#
# A plate is a piece of labware made up of a number of {Well wells}. This class represents the physical piece of
Method do_cherrypick_task
has 92 lines of code (exceeds 25 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]
Class Receptacle
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class Receptacle < Asset # rubocop:todo Metrics/ClassLength
include Uuid::Uuidable
include Commentable
include Transfer::State
include Aliquot::Remover
Method process
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def process # rubocop:todo Metrics/CyclomaticComplexity
# Store the details of the successful submissions so the user can be presented with a summary
@submission_ids = []
@completed_submissions = {}
- 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
File studies_controller.rb
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rexml/document'
# rubocop:todo Metrics/ClassLength
class StudiesController < ApplicationController
# WARNING! This filter bypasses security mechanisms in rails 4 and mimics rails 2 behviour.
Class SubmissionCreator
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Submission::SubmissionCreator < Submission::PresenterSkeleton # rubocop:todo Metrics/ClassLength
SubmissionsCreaterError = Class.new(StandardError)
IncorrectParamsException = Class.new(SubmissionsCreaterError)
InvalidInputException = Class.new(SubmissionsCreaterError)
Class Well
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Well < Receptacle # rubocop:todo Metrics/ClassLength
include Api::WellIO::Extensions
include ModelExtensions::Well
include Cherrypick::VolumeByNanoGrams
include Cherrypick::VolumeByNanoGramsPerMicroLitre
Method configure
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def configure(model) # rubocop:todo Metrics/CyclomaticComplexity
conditions = @options.slice(:if, :on)
save_blank_value = @options.delete(:save_blank)
allow_blank = save_blank_value
model.with_options(conditions) do |object|
- 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 Submission
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class Submission < ApplicationRecord # rubocop:todo Metrics/ClassLength
include Uuid::Uuidable
extend Submission::StateMachine
include Submission::DelayedJobBehaviour
include ModelExtensions::Submission
Class Labware
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class Labware < Asset
include Commentable
include Uuid::Uuidable
include AssetLink::Associations
include SharedBehaviour::Named
Method generate_json_to_object_mapping
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def generate_json_to_object_mapping(json_to_attribute) # rubocop:todo Metrics/CyclomaticComplexity
code = []
# Split the mappings into two to make things easier. Read only attributes are easily
# handled right now, provided there is not a read_write one that shares their name.
- 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 submit
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def submit(user, *accessionables) # rubocop:todo Metrics/CyclomaticComplexity
ActiveRecord::Base.transaction do
submission = Accessionable::Submission.new(self, user, *accessionables)
errors = submission.all_accessionables.map(&:errors).flatten
- 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 User
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class User < ApplicationRecord # rubocop:todo Metrics/ClassLength
include Authentication
extend EventfulRecord
include Uuid::Uuidable
include Swipecardable
Method prepare_order
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def prepare_order(details) # rubocop:todo Metrics/CyclomaticComplexity
# Retrieve common attributes
study = Study.find_by_id_or_name!(details['study id'], details['study name'])
project = Project.find_by_id_or_name!(details['project id'], details['project name'])
user = User.find_by(login: details['user login']) or
Method walk_wells
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def walk_wells # rubocop:todo Metrics/CyclomaticComplexity
# Adjust each of the groups so that any wells that are in the same pool as those at the same position
# in the group to the left are moved to a non-clashing position. Effectively this makes the view of the
# plate slightly jagged.
group_size =
- 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 Basic
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class ProductCriteria::Basic
SUPPORTED_WELL_ATTRIBUTES = %i[
gel_pass
concentration
rin
Class Attribute
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Attribute # rubocop:todo Metrics/ClassLength
attr_reader :name, :default
alias assignable_attribute_name name
Class BulkSubmission
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class BulkSubmission # rubocop:todo Metrics/ClassLength
# Activates the ArrayWithFieldList refinements for this class
using ArrayWithFieldList
# This is the default output from excel
File test_worksheet.rb
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_dependency 'sample_manifest_excel/tags'
module SampleManifestExcel
module Worksheet
##