lib/anonymous_finished_after_filter.rb
Assignment Branch Condition size for included is too high. [20.83/15] Open
Open
def self.included(klass)
class_key = klass.name.sub('Controller', '').tableize
class_key = class_key.singularize if %w(audio video).include?(class_key.singularize)
specs = []
- 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
Method has too many lines. [13/10] Open
Open
def self.included(klass)
class_key = klass.name.sub('Controller', '').tableize
class_key = class_key.singularize if %w(audio video).include?(class_key.singularize)
specs = []
- Read upRead up
- 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.
%w
-literals should be delimited by [
and ]
. Open
Open
class_key = class_key.singularize if %w(audio video).include?(class_key.singularize)
- Read upRead up
- Exclude checks
This cop enforces the consistent usage of %
-literal delimiters.
Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.
Example:
# Style/PercentLiteralDelimiters:
# PreferredDelimiters:
# default: '[]'
# '%i': '()'
# good
%w[alpha beta] + %i(gamma delta)
# bad
%W(alpha #{beta})
# bad
%I(alpha beta)
Avoid multi-line chains of blocks. Open
Open
end.flatten.select do |s|
- Read upRead up
- Exclude checks
This cop checks for chaining of a block after another block that spans multiple lines.
Example:
Thread.list.find_all do |t|
t.alive?
end.map do |t|
t.object_id
end