sanger/limber

View on GitHub

Showing 187 of 187 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

module Presenters::Statemachine
  module Permissive # rubocop:todo Style/Documentation
    extend ActiveSupport::Concern
    included do
      include Shared
Severity: Major
Found in app/models/concerns/presenters/statemachine/permissive.rb and 1 other location - About 2 hrs to fix
app/models/concerns/presenters/statemachine/single_child_permissive.rb on lines 4..62

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 105.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

module Presenters::Statemachine
  module SingleChildPermissive # rubocop:todo Style/Documentation
    extend ActiveSupport::Concern
    included do
      include Shared
app/models/concerns/presenters/statemachine/permissive.rb on lines 4..62

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 105.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

function byRows(wells, plateDims, tagsPerWell, walker) {
  return wells.sort(compareWellsByRow).reduce((acc, well, relIndex) => {
    const [wellCol, wellRow] = wellNameToCoordinate(well.position)
    const absIndex = wellCol + plateDims.number_of_columns * wellRow
    return processTagsPerWell(acc, well, relIndex, absIndex, tagsPerWell, walker)
app/frontend/javascript/custom-tagged-plate/tagLayoutFunctions.js on lines 88..94

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 90.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

function byColumns(wells, plateDims, tagsPerWell, walker) {
  return wells.sort(compareWellsByColumn).reduce((acc, well, relIndex) => {
    const [wellCol, wellRow] = wellNameToCoordinate(well.position)
    const absIndex = wellRow + plateDims.number_of_rows * wellCol
    return processTagsPerWell(acc, well, relIndex, absIndex, tagsPerWell, walker)
app/frontend/javascript/custom-tagged-plate/tagLayoutFunctions.js on lines 68..74

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 90.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Class Robot has 23 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Robot
    include Form

    attr_reader :beds
    attr_accessor :api, :user_uuid, :layout, :name, :id, :verify_robot, :class, :robot_barcode, :require_robot
Severity: Minor
Found in app/models/robots/robot.rb - About 2 hrs to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      def additional_label_definitions
        [
          {
            top_left: date_today,
            bottom_left: labware.barcode.human,
    Severity: Major
    Found in app/models/labels/plate_label_lds_al_lib.rb and 1 other location - About 2 hrs to fix
    app/models/labels/plate_label_ltn_al_lib.rb on lines 14..37

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 90.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      def additional_label_definitions
        [
          {
            top_left: date_today,
            bottom_left: labware.barcode.human,
    Severity: Major
    Found in app/models/labels/plate_label_ltn_al_lib.rb and 1 other location - About 2 hrs to fix
    app/models/labels/plate_label_lds_al_lib.rb on lines 14..37

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 90.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        waitPlate: function () {
          this.clearPlate()
          $(this).closest('.labware-container').removeClass('good-labware bad-labware scan-labware')
          $(this).closest('.labware-container').addClass('wait-labware')
          $('#summary_tab').addClass('ui-disabled')
    Severity: Major
    Found in app/frontend/entrypoints/pages/multi_plate_pooling.js and 1 other location - About 2 hrs to fix
    app/frontend/entrypoints/pages/multi_plate_pooling.js on lines 166..171

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 83.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        badPlate: function () {
          this.clearPlate()
          $(this).closest('.labware-container').removeClass('good-labware wait-labware scan-labware')
          $(this).closest('.labware-container').addClass('bad-labware')
          $('#summary_tab').addClass('ui-disabled')
    Severity: Major
    Found in app/frontend/entrypoints/pages/multi_plate_pooling.js and 1 other location - About 2 hrs to fix
    app/frontend/entrypoints/pages/multi_plate_pooling.js on lines 152..157

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 83.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Class Plate has 22 methods (exceeds 20 allowed). Consider refactoring.
    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
    Severity: Minor
    Found in app/sequencescape/sequencescape/api/v2/plate.rb - About 2 hrs to fix

      Class MultiStampTubesUsingTubeRackScan has 22 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class MultiStampTubesUsingTubeRackScan < Base
          include LabwareCreators::CustomPage
          include SupportParent::TubeOnly
      
          self.page = 'multi_stamp_tubes_using_tube_rack_scan'
      Severity: Minor
      Found in app/models/labware_creators/multi_stamp_tubes_using_tube_rack_scan.rb - About 2 hrs to fix

        Function commentStoreFactory has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const commentStoreFactory = function (axiosInstance, devourApi, assetId, userId) {
          return {
            comments: undefined,
        
            async refreshComments() {
        Severity: Major
        Found in app/frontend/javascript/asset-comments/comment-store.js - About 2 hrs to fix

          Function mockApi has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          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.
          Severity: Major
          Found in app/frontend/javascript/test_support/mock_api.js - About 2 hrs to fix

            Class Well has 21 methods (exceeds 20 allowed). Consider refactoring.
            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'
            Severity: Minor
            Found in app/sequencescape/sequencescape/api/v2/well.rb - About 2 hrs to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              function compareWellsByRow(wellA, wellB) {
                const [wellACol, wellARow, wellBCol, wellBRow] = retrieveWellCoords(wellA, wellB)
                if (wellARow > wellBRow) {
                  return 1
                } else if (wellBRow > wellARow) {
              app/frontend/javascript/custom-tagged-plate/tagLayoutFunctions.js on lines 57..66

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 77.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              function compareWellsByColumn(wellA, wellB) {
                const [wellACol, wellARow, wellBCol, wellBRow] = retrieveWellCoords(wellA, wellB)
                if (wellACol > wellBCol) {
                  return 1
                } else if (wellBCol > wellACol) {
              app/frontend/javascript/custom-tagged-plate/tagLayoutFunctions.js on lines 46..55

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 77.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                def qc_label_definitions
                  [
                    {
                      top_left: date_today,
                      bottom_left: "#{labware.barcode.human} QC3",
              Severity: Major
              Found in app/models/labels/plate_label_ltn_al_lib.rb and 1 other location - About 1 hr to fix
              app/models/labels/plate_label_lds_al_lib.rb on lines 41..61

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 75.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                def qc_label_definitions
                  [
                    {
                      top_left: date_today,
                      bottom_left: "#{labware.barcode.human} QC3",
              Severity: Major
              Found in app/models/labels/plate_label_lds_al_lib.rb and 1 other location - About 1 hr to fix
              app/models/labels/plate_label_ltn_al_lib.rb on lines 41..61

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 75.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              const exampleParentWellSubmissionDetailsForPools = {
                A1: { subm_id: '1', pool_index: 1 },
                A2: { subm_id: '1', pool_index: 1 },
                A3: { subm_id: '2', pool_index: 2 },
                A4: { subm_id: '2', pool_index: 2 },
              app/frontend/javascript/custom-tagged-plate/testData/customTaggedPlateTestData.js on lines 724..729

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 72.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              const exampleParentWellSubmissionDetails = {
                A1: { subm_id: '1', pool_index: 1 },
                A2: { subm_id: '1', pool_index: 1 },
                A3: { subm_id: '1', pool_index: 1 },
                A4: { subm_id: '1', pool_index: 1 },
              app/frontend/javascript/custom-tagged-plate/testData/customTaggedPlateTestData.js on lines 747..752

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 72.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language