Showing 11 of 368 total issues
Method execute_block
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def execute_block
yield
rescue Object => e
@exception_occurred = true
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Class Context
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Context
include ContextHelper::Matchers
include ContextHelper::Should
include ContextHelper::Expectation
include ContextHelper::MemoizedHelpers
Method proxy_existing_method
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def proxy_existing_method(method, options = {}, &_block)
method_alias = "__old_#{method}".to_sym
meta_eval { module_eval { alias_method method_alias, method } }
Method proxy_existing_method
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def proxy_existing_method(method, options = {}, &_block)
method_alias = "__old_#{method}".to_sym
meta_eval { module_eval { alias_method method_alias, method } }
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method satisfy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def satisfy(*args, &_block)
if args.size == 1 && String === args.first
description = args.shift
else
description = ''
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method message_for_raise_error
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.message_for_raise_error(negated, show_class, error_class, show_message, error_message, rescued_exception)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(context, description, block, before_filters, after_filters)
Method message_for_have_items
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.message_for_have_items(negated, subject, expected_number_of_items, actual_number_of_items, key_type_name)
Method mock!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def mock!(method, options = {}, &block)
MotionSpec::Mocks.add([self, method])
behavior =
if block_given?
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method run_postponed_block
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run_postponed_block(block)
# If an exception occurred, we definitely don't need execute any more blocks
execute_block(&block) unless @exception_occurred
@postponed_blocks_count -= 1
unless postponed?
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.run(arg = nil)
unless respond_to?(:handle_specification_begin)
extend(Outputs[ENV['output']] || DEFAULT_OUTPUT_MODULE)
end
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"