Showing 119 of 209 total issues
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return "The anonymizers chain is not configured" if !first_anonymizer_address
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return decoy_page unless File.file?(file_path)
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return response, 'application/octet-stream', cookie
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return 'windows', '.exe' if user_agent['Windows']
Avoid too many return
statements within this method. Open
return {status: DB::QUEUED_AGENT, id: aid, good: good}
Avoid too many return
statements within this method. Open
return {status: DB::CLOSED_AGENT, id: aid, good: good}
Method create_repository
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_repository(session)
# ensure the repository directory is present
Dir::mkdir(REPO_DIR) if not File.directory?(REPO_DIR)
trace :info, "Creating repository for [#{session[:ident]}_#{session[:instance]}]"
- 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 stop
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.stop
return unless @server_handle
trace(:info, "Stopping http server...")
EM.stop_server(@server_handle) if @server_handle
- 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 agent_status
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def agent_status(build_id, instance_id, platform, demo, level)
begin
request = {:ident => build_id, :instance => instance_id, :platform => platform, :demo => demo, :level => level}
ret = rest_call('GET', '/agent/status/?' + CGI.encode_query(request))
- 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 perform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def perform
# if the database connection has gone
# try to re-login to the database again
unless DB.instance.connected?
trace :debug, "heartbeat: try to reconnect to rcs-db"
- 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_conf
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.new_conf(bid)
return nil unless File.exist?(CACHE_FILE)
begin
db = SQLite.open CACHE_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 process_http_request
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_http_request
operation = proc do
begin
# perform the protocol (all the interesting stuff happens here)
- 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
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.get
# don't perform resolution if not wanted
return '' unless Config.instance.global['RESOLVE_IP']
address = ''
- 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 command_conf
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def command_conf(peer, session, message)
trace :info, "[#{peer}][#{session[:cookie]}] Configuration request"
# if the command contains a message
# it is a response to inform us of the stressfulness of the operation
- 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 store_evidence_chunk
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def store_evidence_chunk(session, id, base, chunk, size, content)
Dir::mkdir(REPO_CHUNK_DIR) if not File.directory?(REPO_CHUNK_DIR)
path = REPO_CHUNK_DIR + '/' + session[:ident] + '_' + session[:instance]
header_len = 12
- 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"