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'
File cli.rb
has 507 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'thor'
require 'ribopip'
# rubocop:disable all
module Ribopip
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'
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
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 =
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")
- Read upRead up
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',
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 =
- Read upRead up
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] = []
- Read upRead up
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|
- Read upRead up
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]
- Read upRead up
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)
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 = []
- Read upRead up
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'
- Read upRead up
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)
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')}"
- Read upRead up
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)
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|
- Read upRead up
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]
- Read upRead up
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"