Assignment Branch Condition size for perform is too high. [17.75/15] Open
def perform
output_stream = StreamLogger.new(Rails.logger)
modified_args = ManifestTokenJsonConverter.new(args).replace_with_json_cdx_token
- Read upRead up
- 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
Favor modifier if
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
if cdx_response.key?(:transaction_id)
- Read upRead up
- Exclude checks
Checks for if and unless statements that would fit on one line
if written as a modifier if/unless. The maximum line length is
configured in the Metrics/LineLength
cop.
Example:
# bad
if condition
do_stuff(bar)
end
unless qux.empty?
Foo.do_something
end
# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?
Line is too long. [110/80] Open
Rails.logger.debug(ANSI.blue{ " CDX signature time: #{sprintf('%#g', (cdx_stop - cdx_start))} seconds" })
- Exclude checks
Trailing whitespace detected. Open
- Exclude checks
Missing top-level class documentation comment. Open
class ManifestSigner
- Read upRead up
- Exclude checks
This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.
The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.
Example:
# bad
class Person
# ...
end
# good
# Description/Explanation of Person class
class Person
# ...
end
Favor format
over sprintf
. Open
Rails.logger.debug(ANSI.blue{ " CDX signature time: #{sprintf('%#g', (cdx_stop - cdx_start))} seconds" })
- Read upRead up
- Exclude checks
This cop enforces the use of a single string formatting utility. Valid options include Kernel#format, Kernel#sprintf and String#%.
The detection of String#% cannot be implemented in a reliable manner for all cases, so only two scenarios are considered - if the first argument is a string literal and if the second argument is an array literal.
Example: EnforcedStyle: format(default)
# bad
puts sprintf('%10s', 'hoge')
puts '%10s' % 'hoge'
# good
puts format('%10s', 'hoge')
Example: EnforcedStyle: sprintf
# bad
puts format('%10s', 'hoge')
puts '%10s' % 'hoge'
# good
puts sprintf('%10s', 'hoge')
Example: EnforcedStyle: percent
# bad
puts format('%10s', 'hoge')
puts sprintf('%10s', 'hoge')
# good
puts '%10s' % 'hoge'
Space missing to the left of {. Open
Rails.logger.debug(ANSI.blue{ " CDX signature time: #{sprintf('%#g', (cdx_stop - cdx_start))} seconds" })
- Read upRead up
- Exclude checks
Checks that block braces have or don't have a space before the opening brace depending on configuration.
Example:
# bad
foo.map{ |a|
a.bar.to_s
}
# good
foo.map { |a|
a.bar.to_s
}
Line is too long. [84/80] Open
modified_args = ManifestTokenJsonConverter.new(args).replace_with_json_cdx_token
- Exclude checks