sanger/limber

View on GitHub

Showing 177 of 177 total issues

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

  {
    "resource": "between_tubes_by_submission",
    "attributes": {
      "uuid": "",
      "source_uuid": "",
Severity: Major
Found in app/frontend/javascript/shared/resources.js and 11 other locations - About 40 mins to fix
app/frontend/javascript/shared/resources.js on lines 57..69
app/frontend/javascript/shared/resources.js on lines 97..109
app/frontend/javascript/shared/resources.js on lines 110..122
app/frontend/javascript/shared/resources.js on lines 123..135
app/frontend/javascript/shared/resources.js on lines 136..148
app/frontend/javascript/shared/resources.js on lines 191..203
app/frontend/javascript/shared/resources.js on lines 204..216
app/frontend/javascript/shared/resources.js on lines 217..229
app/frontend/javascript/shared/resources.js on lines 230..242
app/frontend/javascript/shared/resources.js on lines 243..255
app/frontend/javascript/shared/resources.js on lines 951..963

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

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 12 locations. Consider refactoring.
Open

  {
    "resource": "from_plate_to_tube_by_multiplex",
    "attributes": {
      "uuid": "",
      "source_uuid": "",
Severity: Major
Found in app/frontend/javascript/shared/resources.js and 11 other locations - About 40 mins to fix
app/frontend/javascript/shared/resources.js on lines 57..69
app/frontend/javascript/shared/resources.js on lines 97..109
app/frontend/javascript/shared/resources.js on lines 110..122
app/frontend/javascript/shared/resources.js on lines 123..135
app/frontend/javascript/shared/resources.js on lines 136..148
app/frontend/javascript/shared/resources.js on lines 149..161
app/frontend/javascript/shared/resources.js on lines 191..203
app/frontend/javascript/shared/resources.js on lines 204..216
app/frontend/javascript/shared/resources.js on lines 230..242
app/frontend/javascript/shared/resources.js on lines 243..255
app/frontend/javascript/shared/resources.js on lines 951..963

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

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 12 locations. Consider refactoring.
Open

  {
    "resource": "between_plate",
    "attributes": {
      "uuid": "",
      "source_uuid": "",
Severity: Major
Found in app/frontend/javascript/shared/resources.js and 11 other locations - About 40 mins to fix
app/frontend/javascript/shared/resources.js on lines 57..69
app/frontend/javascript/shared/resources.js on lines 97..109
app/frontend/javascript/shared/resources.js on lines 123..135
app/frontend/javascript/shared/resources.js on lines 136..148
app/frontend/javascript/shared/resources.js on lines 149..161
app/frontend/javascript/shared/resources.js on lines 191..203
app/frontend/javascript/shared/resources.js on lines 204..216
app/frontend/javascript/shared/resources.js on lines 217..229
app/frontend/javascript/shared/resources.js on lines 230..242
app/frontend/javascript/shared/resources.js on lines 243..255
app/frontend/javascript/shared/resources.js on lines 951..963

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

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 12 locations. Consider refactoring.
Open

  {
    "resource": "between_plates_by_submission",
    "attributes": {
      "uuid": "",
      "source_uuid": "",
Severity: Major
Found in app/frontend/javascript/shared/resources.js and 11 other locations - About 40 mins to fix
app/frontend/javascript/shared/resources.js on lines 57..69
app/frontend/javascript/shared/resources.js on lines 97..109
app/frontend/javascript/shared/resources.js on lines 110..122
app/frontend/javascript/shared/resources.js on lines 136..148
app/frontend/javascript/shared/resources.js on lines 149..161
app/frontend/javascript/shared/resources.js on lines 191..203
app/frontend/javascript/shared/resources.js on lines 204..216
app/frontend/javascript/shared/resources.js on lines 217..229
app/frontend/javascript/shared/resources.js on lines 230..242
app/frontend/javascript/shared/resources.js on lines 243..255
app/frontend/javascript/shared/resources.js on lines 951..963

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

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 12 locations. Consider refactoring.
Open

  {
    "resource": "between_plate_and_tube",
    "attributes": {
      "uuid": "",
      "source_uuid": "",
Severity: Major
Found in app/frontend/javascript/shared/resources.js and 11 other locations - About 40 mins to fix
app/frontend/javascript/shared/resources.js on lines 57..69
app/frontend/javascript/shared/resources.js on lines 110..122
app/frontend/javascript/shared/resources.js on lines 123..135
app/frontend/javascript/shared/resources.js on lines 136..148
app/frontend/javascript/shared/resources.js on lines 149..161
app/frontend/javascript/shared/resources.js on lines 191..203
app/frontend/javascript/shared/resources.js on lines 204..216
app/frontend/javascript/shared/resources.js on lines 217..229
app/frontend/javascript/shared/resources.js on lines 230..242
app/frontend/javascript/shared/resources.js on lines 243..255
app/frontend/javascript/shared/resources.js on lines 951..963

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

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 exampleChromiumParentUsedOligos = {
  1: {
    'AAAAAAAT:GGGGGGGT:TTTTTTTA:CCCCCCCA': ['submission'],
    'TTTTTTTA:CCCCCCCA:AAAAAAAT:GGGGGGGT': ['submission'],
    'AAAAAAAC:GGGGGGGC:TTTTTTTG:CCCCCCCG': ['submission'],
app/frontend/javascript/custom-tagged-plate/testData/customTaggedPlateTestData.js on lines 704..712

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

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

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