Showing 6 of 8 total issues
Method request
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def request(req)
Net::HTTP.start(@url.host, @url.port) do |http|
http.use_ssl = true if @url.scheme == 'https'
puts "#{req.method} #{req.path}" if @verbos
req['Host'] = @url.host
- 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_properties
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_properties
ret = {}
get("/server-properties.jsp") do |res|
raise ResponceException.new("can't read",res) unless res.code== "200"
doc = HtmlParser.new(res.body)
- 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 compare
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def compare(me,othre)
m = me.shift
o = othre.shift
if m.nil?
return o.nil? ? 0 : -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 database_standard
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def database_standard(driver,serverURL,username,password,
maxConnections=25,minConnections=5,
connectionTimeout=1.0)
Method create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(username,password,name,email,isadmin=false)
Method []
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def []( name )
v = @cache[name]
if v.nil? and @cache.has_key?(name)
if strong_hidden?
:hide
- 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"