sanger/limber

View on GitHub

Showing 187 of 187 total issues

Method binner_next_well has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def binner_next_well(binner, bins, bin, bin_index_within_bins, well_index_within_bin)
Severity: Minor
Found in app/models/utility/pcr_cycles_binning_calculator.rb - About 35 mins to fix

    Method primary_index has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def primary_index(row, column, scale, height, width)
    Severity: Minor
    Found in app/models/limber/tag_layout_template/in_inverse_columns.rb - About 35 mins to fix

      Method primary_index has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def primary_index(row, column, scale, height, _width)
      Severity: Minor
      Found in app/models/limber/tag_layout_template/in_column_then_rows.rb - About 35 mins to fix

        Method primary_index has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def primary_index(row, _column, _scale, _height, _width)
        Severity: Minor
        Found in app/models/limber/tag_layout_template/in_combinatorial_by_rows.rb - About 35 mins to fix

          Method primary_index has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def primary_index(row, column, scale, height, _width)
          Severity: Minor
          Found in app/models/limber/tag_layout_template/in_column_then_columns.rb - About 35 mins to fix

            Function hasExpectedProperties has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            const hasExpectedProperties = (expectedProperties) => {
              return (results) => {
                if (results.length === 0) {
                  return { valid: false, message: 'No results retrieved' }
                }
            Severity: Minor
            Found in app/frontend/javascript/shared/devourApiValidators.js - About 35 mins to fix

            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 child_labware_of_plate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def child_labware_of_plate
                  labware
                    .wells
                    .sort_by(&well_order)
                    .each_with_object([]) do |well, plates|
            Severity: Minor
            Found in app/models/robots/bed/pooling_and_splitting.rb - About 35 mins to fix

            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 validate_each has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def validate_each(record, attribute, value)
                  Array(value).each do |nested|
                    next if nested.valid?
            
                    nested.errors.each do |error|
            Severity: Minor
            Found in lib/nested_validation.rb - About 35 mins to fix

            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 findResults has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            const findResults = (cy, filter) => {
              if (notResults !== undefined) {
                notResults.restore()
              }
            
            
            Severity: Minor
            Found in app/frontend/javascript/pipeline-graph/filterFunctions.js - About 35 mins to fix

            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 check_for_invalid_characters has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                  def check_for_invalid_characters
                    return if empty?
            
                    @row_data.each_with_index do |cell, i|
                      next if cell_is_blank?(cell)
            Severity: Minor
            Found in app/models/labware_creators/common_file_handling/csv_file/row_base.rb - About 35 mins to fix

            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 validateParameters has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            const validateParameters = function (data) {
              let result
            
              if (!data) {
                result = {
            Severity: Minor
            Found in app/frontend/javascript/custom-tagged-plate/tagLayoutFunctions.js - About 35 mins to fix

            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 valid_robot has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def valid_robot
                  return false unless robot_present_if_required
            
                  return true unless verify_robot? && beds.values.first.labware.present?
            
            
            Severity: Minor
            Found in app/models/robots/robot.rb - About 35 mins to fix

            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

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

            const buildPlateObjs = function (number) {
              return buildArray(number, (iteration) => {
                return { state: 'empty', plate: null, index: iteration }
              })
            }
            Severity: Minor
            Found in app/frontend/javascript/shared/plateHelpers.js and 1 other location - About 35 mins to fix
            app/frontend/javascript/shared/tubeHelpers.js on lines 3..7

            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 46.

            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 buildTubeObjs = function (number) {
              return buildArray(number, (iteration) => {
                return { state: 'empty', labware: null, index: iteration }
              })
            }
            Severity: Minor
            Found in app/frontend/javascript/shared/tubeHelpers.js and 1 other location - About 35 mins to fix
            app/frontend/javascript/shared/plateHelpers.js on lines 3..7

            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 46.

            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

            Avoid too many return statements within this method.
            Open

                    return includes.include?(current_state) if includes.present?
            Severity: Major
            Found in app/models/concerns/presenters/statemachine/feature_in_states.rb - About 30 mins to fix

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

                {
                  "resource": "study",
                  "attributes": {
                    "name": "",
                    "uuid": "",
              Severity: Minor
              Found in app/frontend/javascript/shared/resources.js and 1 other location - About 30 mins to fix
              app/frontend/javascript/shared/resources.js on lines 907..919

              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 45.

              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

                {
                  "resource": "tag",
                  "attributes": {
                    "oligo": "",
                    "map_id": "",
              Severity: Minor
              Found in app/frontend/javascript/shared/resources.js and 1 other location - About 30 mins to fix
              app/frontend/javascript/shared/resources.js on lines 826..838

              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 45.

              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 request_hash(source_well, child_plate, additional_parameters)
                    {
                      'source_asset' => source_well.uuid,
                      'target_asset' =>
                        child_plate
              Severity: Minor
              Found in app/models/labware_creators/concentration_normalised_plate.rb and 1 other location - About 30 mins to fix
              app/models/labware_creators/pcr_cycles_binned_plate_base.rb on lines 120..129

              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 32.

              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 request_hash(source_well, child_plate, additional_parameters)
                    {
                      'source_asset' => source_well.uuid,
                      'target_asset' =>
                        child_plate
              Severity: Minor
              Found in app/models/labware_creators/pcr_cycles_binned_plate_base.rb and 1 other location - About 30 mins to fix
              app/models/labware_creators/concentration_normalised_plate.rb on lines 25..34

              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 32.

              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

              Method compute_well_amounts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def compute_well_amounts(wells)
                    # sort on well coordinate to ensure wells are in plate column order
                    wells
                      .sort_by(&:coordinate)
                      .each_with_object({}) do |well, well_amounts|
              Severity: Minor
              Found in app/models/utility/fixed_normalisation_calculator.rb - About 25 mins to fix

              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

              Severity
              Category
              Status
              Source
              Language