Class has too many lines. [188/100] Open
class DatasetTest < Test::Unit::TestCase
include TestHelper
def setup
initialize_miga_home
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for test_preprocessing is too high. [76.16/15] Open
def test_preprocessing
d2 = project.add_dataset('ds_preprocessing')
assert_nil(d2.first_preprocessing)
assert_nil(d2.next_preprocessing)
assert_not_predicate(d2, :done_preprocessing?)
- 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. [50/10] Open
def test_add_result_other
d2 = project.add_dataset('ds_add_result_other')
Dir.mkdir(
File.join(
project.path, 'data', '07.annotation', '01.function', '01.essential',
- 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. [39/10] Open
def test_preprocessing
d2 = project.add_dataset('ds_preprocessing')
assert_nil(d2.first_preprocessing)
assert_nil(d2.next_preprocessing)
assert_not_predicate(d2, :done_preprocessing?)
- 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_add_result_other is too high. [38.05/15] Open
def test_add_result_other
d2 = project.add_dataset('ds_add_result_other')
Dir.mkdir(
File.join(
project.path, 'data', '07.annotation', '01.function', '01.essential',
- 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_profile_advance is too high. [32.02/15] Open
def test_profile_advance
d2 = project.add_dataset('ds_profile_advance')
assert_equal(0, d2.profile_advance(true).first)
assert_equal(0, d2.profile_advance(true).last)
assert_equal(0, d2.profile_advance(true).inject(:+))
- 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_add_result is too high. [21.02/15] Open
def test_add_result
d2 = project.add_dataset('ds_add_result')
assert_nil(d2.add_result(:koop))
assert_nil(d2.add_result(:raw_reads))
FileUtils.touch(
- 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. [15/10] Open
def test_profile_advance
d2 = project.add_dataset('ds_profile_advance')
assert_equal(0, d2.profile_advance(true).first)
assert_equal(0, d2.profile_advance(true).last)
assert_equal(0, d2.profile_advance(true).inject(:+))
- 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_initialize is too high. [19/15] Open
def test_initialize
assert_raise { MiGA::Dataset.new(project, 'dataset-1') }
assert_equal(project, dataset.project)
assert_equal('dataset0', dataset.name)
assert_predicate(dataset, :ref?)
- 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_activate is too high. [18.03/15] Open
def test_activate
d = dataset
assert_equal(:incomplete, d.status)
assert_predicate(d, :active?)
d.inactivate! 'Too annoying'
- 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 test_add_result_other
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_add_result_other
d2 = project.add_dataset('ds_add_result_other')
Dir.mkdir(
File.join(
project.path, 'data', '07.annotation', '01.function', '01.essential',
- Create a ticketCreate a ticket
Method has too many lines. [11/10] Open
def test_save
d2 = project.add_dataset('ds_save')
assert_respond_to(d2, :save)
d2.save
assert_not_predicate(d2, :multi?)
- 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_activate
d = dataset
assert_equal(:incomplete, d.status)
assert_predicate(d, :active?)
d.inactivate! 'Too annoying'
- 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_save is too high. [16.12/15] Open
def test_save
d2 = project.add_dataset('ds_save')
assert_respond_to(d2, :save)
d2.save
assert_not_predicate(d2, :multi?)
- 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_add_result
d2 = project.add_dataset('ds_add_result')
assert_nil(d2.add_result(:koop))
assert_nil(d2.add_result(:raw_reads))
FileUtils.touch(
- 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 test_preprocessing
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_preprocessing
d2 = project.add_dataset('ds_preprocessing')
assert_nil(d2.first_preprocessing)
assert_nil(d2.next_preprocessing)
assert_not_predicate(d2, :done_preprocessing?)
- Create a ticketCreate a ticket
Missing magic comment # frozen_string_literal: true
. Open
require 'test_helper'
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop is designed to help upgrade to Ruby 3.0. It will add the
comment # frozen_string_literal: true
to the top of files to
enable frozen string literals. Frozen string literals may be default
in Ruby 3.0. The comment will be added below a shebang and encoding
comment. The frozen string literal comment is only valid in Ruby 2.3+.
Example: EnforcedStyle: when_needed (default)
# The `when_needed` style will add the frozen string literal comment
# to files only when the `TargetRubyVersion` is set to 2.3+.
# bad
module Foo
# ...
end
# good
# frozen_string_literal: true
module Foo
# ...
end
Example: EnforcedStyle: always
# The `always` style will always add the frozen string literal comment
# to a file, regardless of the Ruby version or if `freeze` or `<<` are
# called on a string literal.
# bad
module Bar
# ...
end
# good
# frozen_string_literal: true
module Bar
# ...
end
Example: EnforcedStyle: never
# The `never` will enforce that the frozen string literal comment does
# not exist in a file.
# bad
# frozen_string_literal: true
module Baz
# ...
end
# good
module Baz
# ...
end
end
at 171, 17 is not aligned with %w[ess.faa ess/log done]
at 168, 23 or .map do |x|
at 169, 12. Open
end,
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks whether the end keywords are aligned properly for do end blocks.
Three modes are supported through the EnforcedStyleAlignWith
configuration parameter:
start_of_block
: the end
shall be aligned with the
start of the line where the do
appeared.
start_of_line
: the end
shall be aligned with the
start of the line where the expression started.
either
(which is the default) : the end
is allowed to be in either
location. The autofixer will default to start_of_line
.
Example: EnforcedStyleAlignWith: either (default)
# bad
foo.bar
.each do
baz
end
# good
variable = lambda do |i|
i
end
Example: EnforcedStyleAlignWith: startofblock
# bad
foo.bar
.each do
baz
end
# good
foo.bar
.each do
baz
end
Example: EnforcedStyleAlignWith: startofline
# bad
foo.bar
.each do
baz
end
# good
foo.bar
.each do
baz
end
Use Hash#key?
instead of Hash#has_key?
. Open
assert { MiGA::Dataset.KNOWN_TYPES.has_key?(:genome) }
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop (by default) checks for uses of methods Hash#haskey? and
Hash#hasvalue? where it enforces Hash#key? and Hash#value?
It is configurable to enforce the inverse, using verbose
method
names also.
Example: EnforcedStyle: short (default)
# bad Hash#haskey? Hash#hasvalue?
# good Hash#key? Hash#value?
Example: EnforcedStyle: verbose
# bad Hash#key? Hash#value?
# good Hash#haskey? Hash#hasvalue?
Align .map
with {
on line 154. Open
.map do |x|
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks the indentation of the method name part in method calls that span more than one line.
Example: EnforcedStyle: aligned
# bad
while myvariable
.b
# do something
end
# good
while myvariable
.b
# do something
end
# good
Thing.a
.b
.c
Example: EnforcedStyle: indented
# good
while myvariable
.b
# do something
end
Example: EnforcedStyle: indentedrelativeto_receiver
# good
while myvariable
.a
.b
# do something
end
# good
myvariable = Thing
.a
.b
.c
end
at 179, 17 is not aligned with %w[pdf wintax mytaxa reg done]
at 176, 19 or .map do |x|
at 177, 12. Open
end,
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks whether the end keywords are aligned properly for do end blocks.
Three modes are supported through the EnforcedStyleAlignWith
configuration parameter:
start_of_block
: the end
shall be aligned with the
start of the line where the do
appeared.
start_of_line
: the end
shall be aligned with the
start of the line where the expression started.
either
(which is the default) : the end
is allowed to be in either
location. The autofixer will default to start_of_line
.
Example: EnforcedStyleAlignWith: either (default)
# bad
foo.bar
.each do
baz
end
# good
variable = lambda do |i|
i
end
Example: EnforcedStyleAlignWith: startofblock
# bad
foo.bar
.each do
baz
end
# good
foo.bar
.each do
baz
end
Example: EnforcedStyleAlignWith: startofline
# bad
foo.bar
.each do
baz
end
# good
foo.bar
.each do
baz
end
Align .map
with {
on line 154. Open
.map do |x|
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks the indentation of the method name part in method calls that span more than one line.
Example: EnforcedStyle: aligned
# bad
while myvariable
.b
# do something
end
# good
while myvariable
.b
# do something
end
# good
Thing.a
.b
.c
Example: EnforcedStyle: indented
# good
while myvariable
.b
# do something
end
Example: EnforcedStyle: indentedrelativeto_receiver
# good
while myvariable
.a
.b
# do something
end
# good
myvariable = Thing
.a
.b
.c