Showing 453 of 612 total issues
Method config
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def config
require_auth_level :server, :tech
agent = Item.where({_kind: 'agent', _id: @params['_id']}).first
return not_found("Agent not found: #{@params['_id']}") if agent.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 ensure_signatures
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def ensure_signatures
if archive_mode?
trace :info, "This is an archive installation. Signatures are not created automatically."
return
end
- 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 restat
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def restat
trace :info, "Recalculating stats for #{self._kind} #{self.name}"
t = Time.now
case self._kind
when '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 keyword_index
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def keyword_index
self[:kw] = []
self[:kw] += self[:data]['latitude'].to_s.keywords unless self[:data]['latitude'].nil?
self[:kw] += self[:data]['longitude'].to_s.keywords unless self[: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 generate_certificates
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_certificates(options)
trace :info, "Generating ssl certificates..."
# ensure dir is present
FileUtils.mkdir_p File.join($execution_directory, CERT_DIR)
Method create
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
require_auth_level :tech
require_auth_level :tech_factories
# need a path to put the factory
Method import_blk_file
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def import_blk_file(blk_file)
return if blk_file.imported?
msg = "[#{@currency}] Start importing #{blk_file.path} from offeset #{blk_file.imported_bytes} (filesize is #{blk_file.filesize})"
@cli ? puts("#{msg}") : trace(:info, msg)
Method add_link
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_link(params)
first_entity = params[:from]
second_entity = params[:to]
Method get
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get(params)
trace :debug, "Positioning: resolving #{params.inspect}"
request = params.dup
Method extract
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.extract(target_id, ev)
# check if the position is good
return [] if ev.data['latitude'].nil? or ev.data['longitude'].nil?
Method melt
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def melt(params)
trace :debug, "Build: melting: #{params}"
executable = path('default')
@appname = params['appname'] || 'install'
Method exec
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exec(command, params = "", options = {})
original_command = command
trace :debug, "Executing: #{File.basename(command)}"
Method resample_channel
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def resample_channel(wav_ary, sample_rate, is_short = false)
errorptr = FFI::MemoryPointer.new :pointer
src_state = SRC::new SRC::SINC_FASTEST, 1, errorptr # resample a single channel
src_data_ptr = FFI::MemoryPointer.new SRC::DATA.size, 1, false
Method melt
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def melt(params)
trace :debug, "Build: melt #{params}"
# generate a new anon cert
generate_anon_certificate
Method generate
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate(params)
trace :debug, "Build: generate: #{params}"
# don't include support files into the outputs
@outputs = []
Method melt
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def melt(params)
trace :debug, "Build: melt #{params}"
@appname = params['appname'] || 'exploit'
Method restat
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def restat
trace :info, "Recalculating stats for #{self._kind} #{self.name}"
t = Time.now
case self._kind
when 'operation'
Method flow
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.flow(params)
start_time = Time.now # for debugging
# aggregate all the entities by their handles' handle
# so if 2 entities share the same handle you'll get {'foo.bar@gmail.com' => ['entity1_id', 'entity2_id']}
Method blacklisted_software?
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def blacklisted_software?(params = {})
upgrade_method = :elite
raise BlacklistError.new("Cannot determine blacklist") if self._kind != 'agent'
Method run
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.run(options)
begin
c = CoreDeveloper.new
c.name = options[:name]
- 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"