Showing 1,637 of 1,651 total issues
Method has too many lines. [11/10] Open
def test_set_bool
o = TestWithOption.new
assert_nil(o.option(:bool))
assert(!o.saved)
assert_raise { o.set_option(:bool, 'true') }
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for test_maxjobs_json is too high. [16.03/15] Open
def test_maxjobs_json
d1 = daemon
helper_datasets_with_results(3)
assert_equal(0, d1.jobs_running.size)
assert_equal(0, d1.jobs_to_run.size)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for test_save is too high. [16.28/15] Open
def test_save
declare_forks
md1 = MiGA::Metadata.new(tmpfile('md_save.json'))
FileUtils.touch(md1.lock_file)
fork do
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [11/10] Open
def test_unlink
r = project.add_result(:clade_finding)
path = r.path
done = r.path(:done)
data = r.file_path(:empty)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [11/10] Open
def test_append
tx = MiGA::Taxonomy.new ''
assert_equal('', "#{tx}")
tx << ['domain:Public', 'family:GNU']
assert_equal('GNU', tx[:f])
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [11/10] Open
def each_project(dir = path)
Dir.entries(dir).each do |f|
next if %w[. ..].include?(f) # Ruby <= 2.3 doesn't have Dir.children
f = File.join(dir, f)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for aai_taxtest is too high. [16.09/15] Open
def aai_taxtest(aai, test, opts = {})
meaning = {
most_likely: [0.00, 0.01],
probably: [0.01, 0.10],
possibly_even: [0.10, 0.50]
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Cyclomatic complexity for save_to is too high. [7/6] Confirmed
def save_to(project, name = nil, is_ref = true, metadata_def = {})
name ||= ids.join('_').miga_name
project = MiGA::Project.new(project) if project.is_a? String
MiGA::Dataset.exist?(project, name) and
raise "Dataset #{name} exists in the project, aborting..."
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
Cyclomatic complexity for launch_job is too high. [7/6] Open
def launch_job(job, hostk = nil)
# Execute job
job[:cmd] = job_cmd(job)
MiGA::MiGA.DEBUG "CMD: #{job[:cmd]}"
case runopts(:type)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
Assignment Branch Condition size for check_directories is too high. [16.88/15] Open
def check_directories
each_project do |project|
d = project_daemon(project)
next if d.active?
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Cyclomatic complexity for get_metadata is too high. [7/6] Open
def get_metadata(metadata_def = {})
metadata_def.each { |k, v| @metadata[k] = v }
return @metadata if @metadata[:bypass_metadata]
case universe
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
Method has too many lines. [11/10] Confirmed
def initialize(ids, db, universe)
ids = [ids] unless ids.is_a? Array
@ids = (ids.is_a?(Array) ? ids : [ids])
@db = db.to_sym
@universe = universe.to_sym
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Cyclomatic complexity for check_datasets is too high. [7/6] Open
def check_datasets
l_say(2, 'Checking datasets')
o = false
project.each_dataset do |ds|
next unless ds.status == :incomplete
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
Perceived complexity for runopts is too high. [8/7] Open
def runopts(k, v = nil, force = false)
k = k.to_sym
unless v.nil?
case k
when :latency, :maxjobs, :ppn, :ppn_project, :format_version, :verbosity,
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop tries to produce a complexity score that's a measure of the
complexity the reader experiences when looking at a method. For that
reason it considers when
nodes as something that doesn't add as much
complexity as an if
or a &&
. Except if it's one of those special
case
/when
constructs where there's no expression after case
. Then
the cop treats it as an if
/elsif
/elsif
... and lets all the when
nodes count. In contrast to the CyclomaticComplexity cop, this cop
considers else
nodes as adding complexity.
Example:
def my_method # 1
if cond # 1
case var # 2 (0.8 + 4 * 0.2, rounded)
when 1 then func_one
when 2 then func_two
when 3 then func_three
when 4..10 then func_other
end
else # 1
do_something until a && b # 2
end # ===
end # 7 complexity points
Method has too many lines. [11/10] Open
def add_result_distances(base, _opts)
return nil unless result_files_exist?(base, ['.txt']) &&
(result_files_exist?(base, ['.rds']) ||
result_files_exist?(base, ['.rda']))
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for run_block is too high. [16.67/15] Open
def run_block(&blk)
busy_attempts ||= 0
io_attempts ||= 0
SQLite3::Database.new(path) { |conn| blk[conn] }
rescue SQLite3::BusyException => e
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Perceived complexity for tabulate is too high. [8/7] Open
def tabulate(header, values, tabular = false)
fields = []
fields << header.map(&:to_s) unless tabular && header.all?(&:nil?)
fields << fields.first.map { |h| h.gsub(/\S/, '-') } unless tabular
fields += values.map { |r| r.map { |cell| cell.nil? ? '?' : cell.to_s } }
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop tries to produce a complexity score that's a measure of the
complexity the reader experiences when looking at a method. For that
reason it considers when
nodes as something that doesn't add as much
complexity as an if
or a &&
. Except if it's one of those special
case
/when
constructs where there's no expression after case
. Then
the cop treats it as an if
/elsif
/elsif
... and lets all the when
nodes count. In contrast to the CyclomaticComplexity cop, this cop
considers else
nodes as adding complexity.
Example:
def my_method # 1
if cond # 1
case var # 2 (0.8 + 4 * 0.2, rounded)
when 1 then func_one
when 2 then func_two
when 3 then func_three
when 4..10 then func_other
end
else # 1
do_something until a && b # 2
end # ===
end # 7 complexity points
Assignment Branch Condition size for perform is too high. [16.28/15] Open
def perform
cli.load_project_or_dataset.each_result do |sym, res|
cli.puts "#{"#{sym}\tjson\t" if cli[:details]}#{res.path}" if cli[:json]
res.each_file do |k, f|
cli.puts "#{"#{sym}\t#{k}\t" if cli[:details]}#{res.dir}/#{f}"
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Cyclomatic complexity for remote_list is too high. [7/6] Open
def remote_list
if cli[:ncbi_list_json] && File.size?(cli[:ncbi_list_json])
return read_ncbi_list_json(cli[:ncbi_list_json])
end
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
Method has too many lines. [11/10] Open
def tabulate(header, values, tabular = false)
fields = []
fields << header.map(&:to_s) unless tabular && header.all?(&:nil?)
fields << fields.first.map { |h| h.gsub(/\S/, '-') } unless tabular
fields += values.map { |r| r.map { |cell| cell.nil? ? '?' : cell.to_s } }
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.