Showing 453 of 612 total issues
File evidence.rb
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative '../db_layer'
require_relative '../position/resolver'
require_relative '../connector_manager'
require_relative '../evidence_dispatcher'
Method load_license
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def load_license(periodic = false)
# load the license file
lic_file = File.join $execution_directory, RCS::DB::Config::CONF_DIR, LICENSE_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
File tasks.rb
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'archive/tar/minitar'
require 'uuidtools'
require 'fileutils'
require 'rcs-common/trace'
require 'rcs-common/temporary'
Method generate_certificates
has a Cognitive Complexity of 29 (exceeds 5 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)
- 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 melt
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def melt(params)
trace :debug, "Build: melt #{params}"
@appname = params['appname'] || 'exploit'
- 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 parse_agents
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_agents(items)
modules = []
return modules if items.nil?
Class AgentController
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class AgentController < RESTController
include RCS::Crypt
def index
require_auth_level :tech, :view
Class Entity
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class Entity
extend RCS::Tracer
include RCS::Tracer
include Mongoid::Document
include Mongoid::Timestamps
Class RESTController
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class RESTController
include RCS::Tracer
include RCS::Common::Rest
# the parameters passed on the REST request
Method status
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def status
require_auth_level :server, :tech
demo = (@params['demo'] == 'true') ? true : false
level = @params['level'].to_sym
- 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 blacklisted_software?
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def blacklisted_software?(params = {})
upgrade_method = :elite
raise BlacklistError.new("Cannot determine blacklist") if self._kind != '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
File call_processor.rb
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'ffi'
require 'mongoid'
require 'stringio'
require 'digest/md5'
Method parse_events
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_events(items)
events = []
return events if items.nil?
Method melt
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def melt(params)
trace :debug, "Build: melting: #{params}"
executable = path('default')
@appname = params['appname'] || 'install'
- 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
File evidence.rb
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'mongoid'
require 'rcs-common/trace'
require 'rcs-common/keywords'
require_relative '../shard'
Method patch
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def patch(params)
trace :debug, "Build: patching: #{params}"
# add the file to be patched to the params
# these params will be passed to the super
- 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
Class Item
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class Item
extend RCS::Tracer
include RCS::Tracer
include RCS::Crypt
include Mongoid::Document
Class DB
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class DB
include Singleton
include RCS::Tracer
def initialize
Method periodic_check
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
def periodic_check
begin
# periodically check for license file
load_license(true)
Method offload_move_evidence
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def self.offload_move_evidence(params)
old_target = ::Item.find(params[:old_target_id])
target = ::Item.find(params[:target_id])
agent = ::Item.find(params[:agent_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"