Showing 7 of 7 total issues
Method run_before_filters
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def run_before_filters
skip = route.options[:skip] || []
skip = [skip] unless skip.is_a? Array
route_before = route.options[:before] || []
- 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 route
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def route(method, path)
method_routes = self.routes.find_all{|x| x.method == method}
method_routes.each do |route|
if route.path =~ WILDCARD_PATTERN
src = "\\A#{route.path.gsub('*','(.*)')}\\Z"
- 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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(method, path, options, before, after, block)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(root='', options={}, before=[], after=[], block=nil)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(env, logger, route, request, response)
Method funkyload
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def funkyload(file)
begin
if cache = loadcache[file]
return if ENV['RACK_ENV'] == 'production'
- 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 call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
logger.debug env.inspect.cyan
request = Request.new(env)
response = Response.new
- 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"