Showing 87 of 187 total issues
File resources.js
has 1217 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Auto-generated by Sequencescape on 2024-09-04 17:09:09 +0100"
* Using develop-Y24-190@8b0e5a6
* bundle exec rake devour:create_config"
*
File customTaggedPlateTestData.js
has 789 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const plateUuid = 'afabla7e-9498-42d6-964e-50f61ded6d9a'
const exampleParent = {
id: '1',
uuid: plateUuid,
Class PlateSplitToTubeRacks
has 60 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class PlateSplitToTubeRacks < Base
include LabwareCreators::CustomPage
include SupportParent::PlateOnly
self.page = 'plate_split_to_tube_racks'
Function sharedSpecs
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const sharedSpecs = (args) => {
const subject = args.subject
const mockLocation = {}
describe('a MultiStamp instance', () => {
File plate_split_to_tube_racks.rb
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require_dependency 'form'
require_dependency 'labware_creators/base'
module LabwareCreators
# Handles the creation of up to 2 child racks of tubes from a single parent 96-well plate.
Class StampedPlateAddingRandomisedControls
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class StampedPlateAddingRandomisedControls < StampedPlate # rubocop:todo Metrics/ClassLength
PARENT_PLATE_INCLUDES =
'wells.requests_as_source,wells.requests_as_source.request_type,' \
'wells.aliquots,wells.aliquots.sample,wells.aliquots.sample.sample_metadata'
File multi_plate_pooling.js
has 293 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import $ from 'jquery'
import SCAPE from '@/javascript/lib/global_message_system.js'
const WELLS_IN_COLUMN_MAJOR_ORDER = [
'A1',
Class Robot
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Robot
include Form
attr_reader :beds
attr_accessor :api, :user_uuid, :layout, :name, :id, :verify_robot, :class, :robot_barcode, :require_robot
Class Plate
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Sequencescape::Api::V2::Plate < Sequencescape::Api::V2::Base
include WellHelpers::Extensions
include Sequencescape::Api::V2::Shared::HasRequests
include Sequencescape::Api::V2::Shared::HasPurpose
include Sequencescape::Api::V2::Shared::HasBarcode
Class MultiStampTubesUsingTubeRackScan
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class MultiStampTubesUsingTubeRackScan < Base
include LabwareCreators::CustomPage
include SupportParent::TubeOnly
self.page = 'multi_stamp_tubes_using_tube_rack_scan'
Function commentStoreFactory
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const commentStoreFactory = function (axiosInstance, devourApi, assetId, userId) {
return {
comments: undefined,
async refreshComments() {
Function mockApi
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const mockApi = function (resources = sequencescapeResources) {
const devour = devourApi({ apiUrl: dummyApiUrl }, resources, dummyApiKey)
const mockedRequests = []
// Find a request in the mockedRequests array that matches the request
// object. If no match is found, return undefined.
Class Well
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Sequencescape::Api::V2::Well < Sequencescape::Api::V2::Base # rubocop:todo Style/Documentation
include Sequencescape::Api::V2::Shared::HasRequests
has_many :qc_results
has_many :requests_as_source, class_name: 'Sequencescape::Api::V2::Request'
has_many :requests_as_target, class_name: 'Sequencescape::Api::V2::Request'
Function addComment
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async addComment(newTitle, newDescription) {
let payload = {
data: {
type: 'comments',
attributes: {
Function limberPlateView
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
let limberPlateView = function (defaultTab) {
let plateElement = $(this)
let control = $('#plate-view-control')
Method can_be_enabled?
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
def can_be_enabled?(states, default: true)
return default unless respond_to?(:state) # No state method.
return default if states.blank? # No states to check.
current_state = state.to_s
- 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 newScanned
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
let newScanned = function (bed, labware) {
let new_li
// $('#whole\\['+bed+'\\]').detach();
new_li = $(document.createElement('li'))
.attr('data-bed', bed)
Function applyMouseEvents
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const applyMouseEvents = function () {
const core = graph.getCore()
core.elements().unbind('mouseover')
core.elements().bind('mouseover', (event) => {
Function extractChildUsedOligos
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function extractChildUsedOligos(parentUsedOligos, parentWellSubmDetails, tagLayout, tagSubstitutions, tagGroupOligos) {
if (
!isValidChildUsedOligoParameters(
parentUsedOligos,
parentWellSubmDetails,
Function generateTooltipContent
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const generateTooltipContent = function (ele) {
// pipeline properties
const pipelineName = graph.getElementPipeline(ele)
// purpose node properties