Showing 4 of 4 total issues
Class Server
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Server
include FileUtilities
attr_reader :server, :client, :request
Method patch_merge!
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def patch_merge!(other_hash, &block)
other_hash.each_pair do |k, v|
tv = self[k]
if tv.is_a?(Hash) && v.is_a?(Hash)
self[k] = tv.patch_merge(v, &block)
- 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 do_GET
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def do_GET(head = false)
path = requested_path
if file?(path)
File.open(path, 'rb') do |file|
- 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 requested_path
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def requested_path
local_path = URI.unescape(URI(request.uri).path)
clean = []
- 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"