lib/contracts/method_handler.rb
Class MethodHandler
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class MethodHandler
METHOD_REFERENCE_FACTORY = {
:class_methods => SingletonMethodReference,
:instance_methods => MethodReference
}.freeze
Assignment Branch Condition size for handle is too high. [15.13/15] Open
Open
def handle
return unless engine?
return if decorators.empty?
validate_decorators!
- 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 execute_on_target
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def execute_on_target(obj, name, method_type, current_engine, *args, &blk)
FIXME found Open
Open
# FIXME : this looks like untested code (commenting it out doesn't make specs red)
- Exclude checks
Empty line detected around arguments. Open
Open
Each definition needs to have a different contract for the parameters.
- Read upRead up
- Exclude checks
This cops checks if empty lines exist around the arguments of a method invocation.
Example:
# bad
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
# good
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
Empty line detected around arguments. Open
Open
#{(matched + [decorator]).map(&:to_s).join("\n")}
- Read upRead up
- Exclude checks
This cops checks if empty lines exist around the arguments of a method invocation.
Example:
# bad
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
# good
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
Empty line detected around arguments. Open
Open
Contract String => String
- Read upRead up
- Exclude checks
This cops checks if empty lines exist around the arguments of a method invocation.
Example:
# bad
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
# good
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
Empty line detected around arguments. Open
Open
Did you accidentally put more than one contract on a single function, like so?
- Read upRead up
- Exclude checks
This cops checks if empty lines exist around the arguments of a method invocation.
Example:
# bad
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
# good
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
Empty line detected around arguments. Open
Open
If you did NOT, then you have probably discovered a bug in this library.
- Read upRead up
- Exclude checks
This cops checks if empty lines exist around the arguments of a method invocation.
Example:
# bad
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
# good
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)