Showing 81 of 177 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,
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', () => {
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 39 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 33 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 renderSourceWells
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SCAPE.renderSourceWells = function () {
let capPoolOffset = 0
for (let plateIndex = 0; plateIndex < SCAPE.plates.length; plateIndex += 1) {
if (SCAPE.plates[plateIndex] === undefined) {
$('.plate-id-' + plateIndex).hide()
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
Function value
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
value: function (value) {
// Steps 1-2.
if (this == null) {
throw new TypeError('this is null or not defined')
}
- 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"