sanger/limber

View on GitHub

Showing 81 of 177 total issues

Method wells_have_required_information has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def wells_have_required_information
      filtered_wells.each do |well|
        next if well.aliquots.empty?

        errors.add(:csv_file, format(MISSING_WELL_DETAIL, well.location)) unless well_details.include? well.location
Severity: Minor
Found in app/models/labware_creators/pcr_cycles_binned_plate_base.rb - About 45 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 generate_position_details_hash has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def generate_position_details_hash
      return {} unless valid?

      tube_rack_scan.each_with_object({}) do |row, position_details_hash|
        # ignore blank rows in file

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 byPlateFixed has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

function byPlateFixed(_well, tags, _relIndex, absIndex, offset, _counters) {
Severity: Minor
Found in app/frontend/javascript/custom-tagged-plate/tagLayoutFunctions.js - About 45 mins to fix

    Function byPlateSeq has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function byPlateSeq(_well, tags, relIndex, _absIndex, offset, _counters) {
    Severity: Minor
    Found in app/frontend/javascript/custom-tagged-plate/tagLayoutFunctions.js - About 45 mins to fix

      Method build_pools has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def build_pools
            pools = []
            current_pool = 0
      
            # wells_grouped_by_collected_by = {0=>['w1', 'w4'], 1=>['w6', 'w2'], 2=>['w9', 'w23']}
      Severity: Minor
      Found in app/models/labware_creators/cardinal_pools_plate.rb - About 45 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 build_transfers_hash has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def build_transfers_hash(bins, number_of_rows, compression_reqd) # rubocop:todo Metrics/AbcSize
            binner = Binner.new(compression_reqd, number_of_rows)
            bins
              .values
              .each_with_object({})
      Severity: Minor
      Found in app/models/utility/normalised_binning_calculator.rb - About 45 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 isValidChildUsedOligoParameters has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        parentUsedOligos,
        parentWellSubmDetails,
        tagLayout,
        tagSubstitutions,
        tagGroupOligos,
      Severity: Minor
      Found in app/frontend/javascript/custom-tagged-plate/tagClashFunctions.js - 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_rows.rb - About 35 mins to fix

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

              def self.load(name, options, store, submission_templates, label_template_config)
            Severity: Minor
            Found in lib/purpose_config.rb - About 35 mins to fix

              Function extractChildUsedOligos has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function extractChildUsedOligos(parentUsedOligos, parentWellSubmDetails, tagLayout, tagSubstitutions, tagGroupOligos) {
              Severity: Minor
              Found in app/frontend/javascript/custom-tagged-plate/tagClashFunctions.js - 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_inverse_rows.rb - About 35 mins to fix

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

                      def initialize(name, options, store, submission_templates, label_template_config)
                    Severity: Minor
                    Found in lib/purpose_config.rb - About 35 mins to fix

                      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_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_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_inverse_columns.rb - About 35 mins to fix

                              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.nil?
                              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

                              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

                              Severity
                              Category
                              Status
                              Source
                              Language