sanger/sequencescape

View on GitHub

Showing 283 of 5,433 total issues

Method accession_submission_xml has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def accession_submission_xml(submission, accession_number) # rubocop:todo Metrics/AbcSize
    xml = Builder::XmlMarkup.new
    xml.instruct!
    xml.SUBMISSION(
      'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
Severity: Minor
Found in app/models/accession_service.rb - About 1 hr to fix

    Method encode has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def encode(object, options = {}) # rubocop:todo Metrics/CyclomaticComplexity
          case object
          when NilClass
            unencoded('null')
          when Symbol
    Severity: Minor
    Found in app/api/core/io/json/stream.rb - About 1 hr to fix

      Method create has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def create # rubocop:todo Metrics/AbcSize
          @creator = plate_creator = Plate::Creator.find(params[:plates][:creator_id])
          barcode_printer = BarcodePrinter.find(params[:plates][:barcode_printer])
          source_plate_barcodes = params[:plates][:source_plates]
          create_asset_group = params[:plates][:create_asset_group] == 'Yes'
      Severity: Minor
      Found in app/controllers/plates_controller.rb - About 1 hr to fix

        Method check_inputs_to_volume_to_cherrypick_by_nano_grams! has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          def check_inputs_to_volume_to_cherrypick_by_nano_grams!(minimum_volume, maximum_volume, target_ng, source_well)
            raise 'Source well not found' if source_well.nil?
        
            if minimum_volume.blank? || minimum_volume <= 0.0
              raise Cherrypick::VolumeError,
        Severity: Minor
        Found in app/models/cherrypick/volume_by_nano_grams.rb - About 1 hr 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 accession_submission_xml has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          def accession_submission_xml(submission, accession_number) # rubocop:todo Metrics/AbcSize
            xml = Builder::XmlMarkup.new
            xml.instruct!
            xml.SUBMISSION(
              'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
        Severity: Minor
        Found in app/models/accession_service.rb - About 1 hr 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 convert_json_attributes_to_attributes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def convert_json_attributes_to_attributes(json_attributes) # rubocop:todo Metrics/AbcSize
              return {} if json_attributes.blank?
        
              attributes = {}
              attribute_to_json_attribute_mappings.each do |attribute, json_attribute|
        Severity: Minor
        Found in app/models/api/base.rb - About 1 hr 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 stock_wells has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          def stock_wells # rubocop:todo Metrics/AbcSize, Metrics/MethodLength
            # Optimisation: if the plate is a stock plate then it's wells are it's stock wells!]
            if stock_plate?
              wells.with_pool_id.index_with { |w| [w] }
            else
        Severity: Minor
        Found in app/models/plate.rb - About 1 hr 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 xml has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def xml # rubocop:todo Metrics/AbcSize
              xml = Builder::XmlMarkup.new
              xml.instruct!
              xml.SAMPLE_SET('xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance') do
                xml.SAMPLE(sample_element_attributes) do
        Severity: Minor
        Found in app/models/accessionable/sample.rb - About 1 hr 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 transfer_requests_io= has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          def transfer_requests_io=(parameters) # rubocop:todo Metrics/AbcSize
            uuid_cache = UuidCache.new(parameters)
        
            updated_attributes =
              parameters.map do |parameter|
        Severity: Minor
        Found in app/models/transfer_request_collection.rb - About 1 hr 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_entered_oligos has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          def check_entered_oligos # rubocop:todo Metrics/AbcSize
            invalid_oligos_list = []
            valid_oligos_hash = {}
            parse_oligos_list.each do |cur_oligo|
              if cur_oligo.match?(/^[ACGTacgt]*$/)
        Severity: Minor
        Found in app/models/tag_group/form_object.rb - About 1 hr 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 save has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          def save
            return false unless valid?
        
            ActiveRecord::Base.transaction do
              fail_requests if requested_fail.present?
        Severity: Minor
        Found in app/models/batch/request_fail_and_remover.rb - About 1 hr 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 record_plate_samples has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

              def record_plate_samples # rubocop:todo Metrics/AbcSize
                sm_sample_assets = sample_manifest.sample_manifest_assets.to_a
        
                first_to_last.each_with_index do |sheet_row, sample_index|
                  cur_sm_sample_asset = sm_sample_assets.fetch(sample_index)

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

          def filter_barcode_to_plate_index(destinations)
            destinations.each_with_object({}) do |(destination_barcode, destination_info), all_barcodes|
              mapping_sorted = sort_mapping_by_destination_well(destination_barcode, destination_info['mapping'])
              mapping_sorted.each do |map_well|
                barcode, _well = map_well['src_well']
        Severity: Minor
        Found in app/models/robot/verification/base.rb - About 1 hr 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 run has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

                def run(tag_group) # rubocop:todo Metrics/MethodLength
                  return unless valid?
        
                  unless @tube_rack_information_previously_processed
                    @rack_size = upload.sample_manifest.tube_rack_purpose.size

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

              def add_cell_data(column, row_num, partial) # rubocop:todo Metrics/CyclomaticComplexity
                if partial && empty_row?(row_num)
                  (data[column.name] || dynamic_attributes[row_num][column.name]) unless empty_columns.include?(column.name)
                elsif validation_errors.include?(:insert_size_from) && column.name == 'insert_size_from' &&
                      row_num == computed_first_row

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

          def page_title(title, subtitle = nil, titlecase: true, badges: []) # rubocop:todo Metrics/AbcSize
            tag.div(class: 'page-header') do
              title_class = title.length > 25 ? 'title-long' : 'title-short'
              tag.h1(class: title_class) do
                if titlecase
        Severity: Minor
        Found in app/helpers/bootstrap_helper.rb - About 1 hr 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 to_hash has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def to_hash(object) # rubocop:todo Metrics/CyclomaticComplexity
              # If the object is nil we get a chance to use the 'default' object that was specified.  By
              # default the "default" object is nil, but you can override it for associations through the
              # with_association(:name, :if_nil_use => :some_method).
              object ||= default_object
        Severity: Minor
        Found in app/models/api/base.rb - About 1 hr to fix

          Method authenticate_with_ldap has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def authenticate_with_ldap(login, password) # rubocop:todo Metrics/AbcSize, Metrics/MethodLength
                # TODO: - Extract LDAP specifics to configuration
                username = "uid=#{login},ou=people,dc=sanger,dc=ac,dc=uk"
                ldap =
                  Net::LDAP.new(
          Severity: Minor
          Found in app/models/user/authentication.rb - About 1 hr to fix

            Method post_files has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def post_files(file_params) # rubocop:todo Metrics/CyclomaticComplexity
                rc = rest_client_resource
            
                if configatron.disable_web_proxy == true
                  RestClient.proxy = nil
            Severity: Minor
            Found in app/models/accession_service.rb - About 1 hr to fix

              Function validateOrganism has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const validateOrganism = function (common_name_field, taxon_id_field) {
                // Empty fields can be ignored
                if (common_name_field.value == "" || common_name_field.value == undefined) {
                  return;
                }
              Severity: Minor
              Found in app/frontend/entrypoints/organism_validation.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language