Showing 119 of 209 total issues
Method print_average
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def print_average(section)
puts "Average by #{section.to_s} statistics:"
table_width = 0
@stats[:total].each_key do |k|
- 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 update_status
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_status(component, ip, status, message, stats, type, version)
Method sync_start
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def sync_start(session, version, user, device, source, time)
Method new_uploads?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def new_uploads?(bid)
# check if we have the uploads in the cache
# probably and old one not yet sent
return true if DBCache.new_uploads? bid
# cannot reach the db, return false
- 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 sync_update
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def sync_update(session, version, user, device, source, time)
Method new_filesystems?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def new_filesystems?(bid)
# check if we have the filesystems in the cache
# probably and old one not yet sent
return true if DBCache.new_filesystems? bid
# cannot reach the db, return false
- 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 commands
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.commands(peer, cookie, content)
# retrieve the session
session = SessionManager.instance.get cookie
# invalid session
- 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 http_put_file
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def http_put_file(uri, content)
begin
path = Dir.pwd + PUBLIC_DIR
# split the path in all the subdir and the filename
- 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 new_exec?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def new_exec?(bid)
# check if we have any exec in the cache
# probably and old one not yet sent
return true if DBCache.new_exec? bid
# cannot reach the db, return false
- 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 new_downloads?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def new_downloads?(bid)
# check if we have the downloads in the cache
# probably and old one not yet sent
return true if DBCache.new_downloads? bid
# cannot reach the db, return false
- 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 sync_start
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def sync_start(session, version, user, device, source, time)
Method sync_start
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def sync_start(session, version, user, device, source, time)
Method store_evidence_chunk
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def store_evidence_chunk(session, id, base, chunk, size, content)
Method sync_update
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def sync_update(session, version, user, device, source, time)
Method prepare_request
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def prepare_request(method, uri, query, content, http, peer)
Method agent_status
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def agent_status(build_id, instance_id, platform, demo, level)
Method agent_status
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def agent_status(build_id, instance_id, platform, demo, level)
Method parse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.parse(peer, uri, cookie, content, anon_version)
Method new_upgrade?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def new_upgrade?(bid)
# cannot reach the db, return false
return false unless @available
# remove any pending entry in the cache
- 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 print_section
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def print_section(section)
puts "Last 5 #{section.to_s} statistics:"
table_width = 0
@stats[:total].each_key do |k|
- 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"