stepf/RiboPip

View on GitHub

Showing 19 of 19 total issues

Method postproc has 216 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def postproc
      require 'ribopip/deseq'
      require 'ribopip/expression_analysis'
      require 'ribopip/filenames'
      require 'ribopip/gene_id_2_name'
Severity: Major
Found in lib/ribopip/cli.rb - About 1 day to fix

    File cli.rb has 507 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'thor'
    require 'ribopip'
    
    # rubocop:disable all
    module Ribopip
    Severity: Major
    Found in lib/ribopip/cli.rb - About 1 day to fix

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

          def align
            require 'ribopip/array_writer'
            require 'ribopip/binary_checker'
            require 'ribopip/counts'
            require 'ribopip/feature_counts'
      Severity: Major
      Found in lib/ribopip/cli.rb - About 5 hrs to fix

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

                def self.compute_distri(infile, outdistri, outsums, annotation)
                  fail "#{infile} does not exist." unless File.exist?(infile)
            
                  # build feature index for annotation, if non-existent
                  write_index(annotation) unless File.exist?("#{annotation}.types")
            Severity: Minor
            Found in lib/ribopip/feature_counts.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 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 identify has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                      def identify
                        @basenames.each_with_index do |names, idx|
                          @significant_genes_deseq[1][idx] = []
                          @significant_genes_deseq[2][idx] = []
              
              
              Severity: Minor
              Found in lib/ribopip/deseq.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 compute_exp_outline has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                    def compute_exp_outline
                      rep_names = []
                      cond_types = []
                      cond_names = []
                      @reps.each_with_index do |rep, i|
              Severity: Minor
              Found in lib/ribopip/expression_analysis.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 translate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def translate(id_col, infile, outfile, delimiter = "\t")
                    out = File.open(outfile, 'w')
                    File.readlines(infile).each do |line|
                      inelems = line.split(delimiter)
                      gene_id = inelems[id_col]
              Severity: Minor
              Found in lib/ribopip/gene_id_2_name.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 write has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                        def write(manual = [])
                          @basenames.each_with_index do |names, idx|
                            # Compute symmetric difference
                            idx2 = idx == 0 ? 1 : 0
                            targets_deseq = []
                Severity: Minor
                Found in lib/ribopip/deseq.rb - About 55 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 postproc has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    def postproc
                      require 'ribopip/deseq'
                      require 'ribopip/expression_analysis'
                      require 'ribopip/filenames'
                      require 'ribopip/gene_id_2_name'
                Severity: Minor
                Found in lib/ribopip/cli.rb - About 55 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 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

                    Method plot has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def self.plot(infile, outfile)
                            fail "#{infile} does not exist." unless File.exist?(infile)
                            # convert gt seqstat output to gnuplot-compatible *.dat-file
                            datfile = File.open("#{infile}.dat", 'w')
                            File.readlines(infile).each do |line|
                    Severity: Minor
                    Found in lib/ribopip/metrics.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 build_index has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def build_index
                          # parse annotation
                          File.readlines(@annot).each do |line|
                            next if line[0..1] == '#!'
                            gene_id = line[/gene_id\W+\w+/].delete('"').split[1]
                    Severity: Minor
                    Found in lib/ribopip/gene_id_2_name.rb - About 25 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