Showing 453 of 612 total issues
Method upgrade
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def upgrade
require_auth_level :server, :sys
mongoid_query do
collector = Collector.find(@params['_id'])
- 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 run
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def run(options)
# config file parsing
return 1 unless RCS::DB::Config.instance.load_from_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 cleanup_storage
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cleanup_storage
count = 0
db = DB.instance
total_size = db.db_stats['dataSize']
Method prepare_response
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def prepare_response(connection, request)
@request = request
@connection = connection
@response = EM::DelegatedHttpResponse.new @connection
Method generate
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate(params)
trace :debug, "Build: generate: #{params}"
names = {}
funcnames = []
Method extract_chat
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.extract_chat(ev)
data = []
# "peer" attribute was present before 9.0.0
# than has been replaced by "from" and "rcpt"
- 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_position_aggregate
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.process_position_aggregate entity, aggregate
position = aggregate.position
position_ary = [position[:longitude], position[:latitude]]
operation_id = entity.path.first
- 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 pack
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def pack(params)
trace :debug, "Build: pack: #{params}"
case params['type']
when 'remote'
- 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 keywordize_position
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.keywordize_position(data, note)
kw = SortedSet.new
kw += data['latitude'].to_s.keywords unless data['latitude'].nil?
kw += data['longitude'].to_s.keywords unless data['longitude'].nil?
- 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 run
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def run(options)
run_with_rescue do
# initialize random number generator
srand(Time.now.to_i)
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
def self.perform
now = Time.now.getutc
begin
- 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 exec
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def exec(command, params = "", options = {})
original_command = command
trace :debug, "Executing: #{File.basename(command)}"
- 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 patch
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def patch(params)
# skip the phase if not needed
return if params.nil? or params[:core].nil?
trace :debug, "Build: patching [#{params[:core]}] file"
Method process_http_request
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_http_request
#trace :debug, "[#{@peer}] Incoming HTTP Connection"
size = (@http_post_content) ? @http_post_content.bytesize : 0
# get it again since if the connection is kept-alive we need a fresh timing for each
Class Build
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Build
include RCS::Tracer
attr_reader :outputs
attr_reader :scrambled
File rest.rb
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'audit'
require_relative 'rest_response'
# from RCS::Common
require 'rcs-common/trace'
Method run
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def run
process = Proc.new do
begin
@total = total
next_entry do
- 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 burn_one_license
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def burn_one_license(type, platform)
# check if the platform can be used
unless @limits[:agents][platform][0]
trace :warn, "You don't have a license for #{platform.to_s}. Queuing agent..."
- 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_backup
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.do_backup(now, backup, save_status = true)
trace :info, "Performing backup [#{backup.name}]..."
Audit.log :actor => '<system>', :action => 'backup.start', :desc => "Performing backup #{backup.name}"
File backup.rb
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'db_layer'
# from RCS::Common
require 'rcs-common/trace'