sanger/sequencescape

View on GitHub

Showing 5,424 of 5,426 total issues

Complex method Tasks::CherrypickHandler#do_cherrypick_task (191.8)
Open

  def do_cherrypick_task(_task, params) # rubocop:todo Metrics/CyclomaticComplexity
    plates = params[:plate]
    size = params[:plate_size]
    plate_type = params[:plate_type]

Severity: Minor
Found in app/models/tasks/cherrypick_handler.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method namespace(limber)::task#create_submission_templates (182.9)
Open

       ] do
    puts 'Creating submission templates....'

    base_list = %w[
      illumina_b_hiseq_2500_paired_end_sequencing
Severity: Minor
Found in lib/tasks/limber.rake by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method BulkSubmission#prepare_order (141.2)
Open

  def prepare_order(details) # rubocop:todo Metrics/CyclomaticComplexity
    # Retrieve common attributes
    study = Study.find_by_id_or_name!(details['study id'], details['study name'])
    project = Project.find_by_id_or_name!(details['project id'], details['project name'])
    user = User.find_by(login: details['user login']) or
Severity: Minor
Found in app/models/bulk_submission.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method Core::Io::Base::JsonFormattingBehaviour::Input#generate_json_to_object_mapping (114.9)
Open

  def generate_json_to_object_mapping(json_to_attribute) # rubocop:todo Metrics/CyclomaticComplexity
    code = []

    # Split the mappings into two to make things easier.  Read only attributes are easily
    # handled right now, provided there is not a read_write one that shares their name.

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method Api::EndpointHandler::file_addition (112.2)
Open

      def file_addition(action, http_method) # rubocop:todo Metrics/AbcSize
        send(
          http_method,
          %r{/([\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12})(?:/([^/]+(?:/[^/]+)*))?},
          file_attached: true
Severity: Minor
Found in app/middleware/api/endpoint_handler.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Class Batch has 55 methods (exceeds 20 allowed). Consider refactoring.
Open

class Batch < ApplicationRecord # rubocop:todo Metrics/ClassLength
  include Api::BatchIO::Extensions
  include Api::Messages::FlowcellIO::Extensions
  include AASM
  include SequencingQcBatch
Severity: Major
Found in app/models/batch.rb - About 7 hrs to fix

    Class Plate has 51 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Plate < Labware # rubocop:todo Metrics/ClassLength
      include Api::PlateIO::Extensions
      include ModelExtensions::Plate
      include Transfer::Associations
      include Transfer::State::PlateState
    Severity: Major
    Found in app/models/plate.rb - About 7 hrs to fix

      Complex method Submission::LinearRequestGraph#create_request_chain! (101.7)
      Open

        def create_request_chain!(request_type_and_multiplier_pairs, source_data_set, multiplexing_assets, &block) # rubocop:todo Metrics/CyclomaticComplexity
          raise StandardError, 'No request types specified!' if request_type_and_multiplier_pairs.empty?
      
          request_type, multiplier = request_type_and_multiplier_pairs.shift
      
      

      Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

      You can read more about ABC metrics or the flog tool

      Complex method AccessionService#submit (99.9)
      Open

        def submit(user, *accessionables) # rubocop:todo Metrics/CyclomaticComplexity
          ActiveRecord::Base.transaction do
            submission = Accessionable::Submission.new(self, user, *accessionables)
      
            errors = submission.all_accessionables.map(&:errors).flatten
      Severity: Minor
      Found in app/models/accession_service.rb by flog

      Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

      You can read more about ABC metrics or the flog tool

      Complex method namespace(support)::task#update_library_types (95.7)
      Open

        task :update_library_types, %i[batch_id library_type_name] => [:environment] do |_task, args|
          puts('*' * 80)
          puts('TASK STARTING')
          puts('*' * 80)
          start = Time.zone.now

      Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

      You can read more about ABC metrics or the flog tool

      Complex method Tasks::CherrypickHandler#render_cherrypick_task (95.1)
      Open

        def render_cherrypick_task(_task, params) # rubocop:todo Metrics/CyclomaticComplexity
          if flash[:error].present?
            redirect_to action: 'stage', batch_id: @batch.id, workflow_id: @workflow.id, id: (@stage - 1).to_s
            return
          end
      Severity: Minor
      Found in app/models/tasks/cherrypick_handler.rb by flog

      Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

      You can read more about ABC metrics or the flog tool

      Complex method BulkSubmission#process (89.1)
      Open

        def process # rubocop:todo Metrics/CyclomaticComplexity
          # Store the details of the successful submissions so the user can be presented with a summary
          @submission_ids = []
          @completed_submissions = {}
      
      
      Severity: Minor
      Found in app/models/bulk_submission.rb by flog

      Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

      You can read more about ABC metrics or the flog tool

      Complex method Studies::InformationController#show_summary (88.9)
      Open

        def show_summary # rubocop:todo Metrics/CyclomaticComplexity
          page_params = { page: params[:page] || 1, per_page: params[:per_page] || 50 }
      
          if request.xhr?
            @summary = params[:summary] || 'assets-progress'

      Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

      You can read more about ABC metrics or the flog tool

      File batch.rb has 416 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'timeout'
      require 'aasm'
      
      # A {Batch} groups 1 or more {Request requests} together to enable processing in a
      # {Pipeline}. All requests in a batch get usually processed together, although it is
      Severity: Minor
      Found in app/models/batch.rb - About 6 hrs to fix

        Class Request has 43 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class Request < ApplicationRecord # rubocop:todo Metrics/ClassLength
          # Include
          include ModelExtensions::Request
          include Aliquot::DeprecatedBehaviours::Request
          include Api::RequestIO::Extensions
        Severity: Minor
        Found in app/models/request.rb - About 5 hrs to fix

          Complex method Batch#swap (82.1)
          Open

            def swap(current_user, batch_info = {}) # rubocop:todo Metrics/CyclomaticComplexity
              return false if batch_info.empty?
          
              # Find the two lanes that are to be swapped
              batch_request_left =
          Severity: Minor
          Found in app/models/batch.rb by flog

          Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

          You can read more about ABC metrics or the flog tool

          File study.rb has 396 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'aasm'
          
          # A Study is a collection of various {Sample samples} and the work done on them.
          # They are perhaps slightly overloaded, and provide:
          # - A means of grouping together samples for administrative purposes
          Severity: Minor
          Found in app/models/study.rb - About 5 hrs to fix

            Complex method ReceptaclesController#create_request (81.5)
            Open

              def create_request # rubocop:todo Metrics/AbcSize
                @request_type = RequestType.find(params[:request_type_id])
                @study = Study.find(params[:study_id]) if params[:cross_study_request].blank?
                @project = Project.find(params[:project_id]) if params[:cross_project_request].blank?
            
            

            Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

            You can read more about ABC metrics or the flog tool

            File request.rb has 392 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'aasm'
            
            # A Request represents work which needs to be done, either to fulfil a customers
            # needs {CustomerRequest} or for internal reasons {SystemRequest}.
            # The progress of a request is tracked through its {Request::Statemachine state machine}.
            Severity: Minor
            Found in app/models/request.rb - About 5 hrs to fix

              File sample.rb has 386 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'rexml/text'
              
              #
              # A {Sample} is an abstract concept, with represents the life of a sample of DNA/RNA
              # as it moves through our processes. As a result, a sample may exist in multiple
              Severity: Minor
              Found in app/models/sample.rb - About 5 hrs to fix
                Severity
                Category
                Status
                Source
                Language