Showing 11 of 11 total issues
Method call
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
req = Rack::Request.new(env)
subdomain = env['SUBDOMAIN'] ? "#{env['SUBDOMAIN']}:" : ''
- 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 26 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
req = Rack::Request.new(env)
status, headers, response = @app.call(env)
if status == 200
- 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 get_current_translation
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_current_translation(path, tail = nil)
uri = URI.parse(path)
# find directly
translation = Rewritten.z_range("to:#{path}", -1)
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(env)
req = Rack::Request.new(env)
subdomain = env['SUBDOMAIN'] ? "#{env['SUBDOMAIN']}:" : ''
Method infinitive
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def infinitive(some_from)
some_from ||= ''
conjugated = some_from.chomp('/')
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
puts '-> Rack::Rewritten::Subdomain'
req = Rack::Request.new(env)
@fqdns.each do |n|
- 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
Avoid too many return
statements within this function. Open
return 'about ' + (parseInt(delta / 3600)).toString() + ' hours ago';
Avoid too many return
statements within this function. Open
return $r.strftime(fromTime, fmt);
Avoid too many return
statements within this function. Open
return '1 day ago';
Avoid too many return
statements within this function. Open
return days + " days ago"
Method includes?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def includes?(path)
result = Rewritten.redis.hget("from:#{path.chomp('/')}", :to)
result = Rewritten.redis.hget("from:#{path.split('?')[0]}", :to) unless result
if result.nil? && translate_partial && path.count('/') > 1
- 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"