stepf/RiboPip

View on GitHub
lib/ribopip/pipeline.rb

Summary

Maintainability
C
1 day
Test Coverage

File pipeline.rb has 299 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'ribopip'

module Ribopip
  # Pre-Processing and Alignment Pipeline for Ribosome Profiling Data.
  module Pipeline
Severity: Minor
Found in lib/ribopip/pipeline.rb - About 3 hrs to fix

    Method align has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def align(ref, ref_base, software, opts = {})
            if software == :tophat
              bt_flag =
                opts[:tophat_aligner] == :bowtie1 ? '--bowtie1' : ''
              gap_flag =
    Severity: Minor
    Found in lib/ribopip/pipeline.rb - About 2 hrs to fix

      Method index has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def index(ref, ref_base, software, annotation = '')
              index_suffix = {
                bowtie1: '4.ebwt',
                bowtie2: '4.bt2',
                bwa: '.sa',
      Severity: Minor
      Found in lib/ribopip/pipeline.rb - About 1 hr to fix

        Method align has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

              def align(ref, ref_base, software, opts = {})
                if software == :tophat
                  bt_flag =
                    opts[:tophat_aligner] == :bowtie1 ? '--bowtie1' : ''
                  gap_flag =
        Severity: Minor
        Found in lib/ribopip/pipeline.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 initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              def initialize(names, force_overwrite, ref, software,
                             annotation, tophat_aligner, mismatches, err_rate)
        Severity: Major
        Found in lib/ribopip/pipeline.rb - About 1 hr to fix

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

                def initialize(names, force_overwrite, minlen, linker, software, err_rate)
          Severity: Minor
          Found in lib/ribopip/pipeline.rb - About 45 mins to fix

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

                  def bucketize(error_rate)
                    buckets = []
                    run_cmd(
                      "fastq-bucketize #{@names.get('fp')} #{error_rate} " \
                      "2> #{@names.get('buckets')}"
            Severity: Minor
            Found in lib/ribopip/pipeline.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 initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  def initialize(names, force_overwrite, ref, software, seedlen)
            Severity: Minor
            Found in lib/ribopip/pipeline.rb - About 35 mins to fix

              There are no issues that match your filters.

              Category
              Status