Showing 453 of 612 total issues
Method add_config
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def add_config
require_auth_level :tech
require_auth_level :tech_config
mongoid_query 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 get_app_info
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def get_app_info(file)
# Read info from original package
fd = File.open(file, "rb")
raise "Invalid input file" unless fd
- 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 rcs-core.rb
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'net/http'
require 'json'
require 'open-uri'
require 'pp'
require 'cgi'
Method positions_flow
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.positions_flow(ids, from, to, options = {})
ext = 70*60
t = Time.at(from.to_i)
from = Time.new(t.year, t.month, t.day, t.hour, t.min, 0).to_i
Class Config
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Config
include Singleton
include Tracer
CONF_DIR = 'config'
Class EvidenceController
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class EvidenceController < RESTController
SYNC_IDLE = 0
SYNC_IN_PROGRESS = 1
SYNC_TIMEOUTED = 2
Method inject_html_flash
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def inject_html_flash(intercept_files, progressive, redirect_user, rule, vector_files)
appname = 'FlashSetup-' + progressive.to_s
intercept_files << "#{redirect_user["#{rule.ident} #{rule.ident_param}"]} #{rule.action} #{appname} #{rule.resource}"
begin
Method new_instance
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def new_instance(agent)
::Alert.where(:enabled => true, :action => 'INSTANCE').each do |alert|
#find its factory
factory = ::Item.where({ident: agent.ident, _kind: 'factory'}).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 process_queued
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def process_queued(queued)
entry = queued.first
count = queued.last
trace :info, "#{count} alerts to be processed in queue"
- 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 filesystem
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def filesystem
require_auth_level :view
require_auth_level :view_filesystem
mongoid_query 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 frontend
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def frontend
collectors = ::Collector.where({type: 'local'}).to_a
anons = ::Collector.where({type: 'remote'}).to_a
system_status = ::Status.all.to_a
- 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 name_from_handle
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def self.name_from_handle(type, handle, target_id)
# use a class cache
@@acc_cache ||= LRUCache.new(:ttl => 24.hour)
- 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 common_filter
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def self.common_filter(params)
# filtering
filter = {}
filter = JSON.parse(params['filter']) if params.has_key? 'filter' and params['filter'].is_a? String
- 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 next_entry
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def next_entry
injector = ::Injector.find(@params['injector_id'])
base = rand(10)
progressive = 0
Method export
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def export(evidence, opts)
# expand the sytles in the dest dir
FileTask.expand_styles do |name, content|
yield 'stream', name, {content: content}
end
Method new_entity
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def new_entity(entity)
::Alert.where(:enabled => true, :action => 'ENTITY').each do |alert|
# skip non matching entities
next unless match_path(alert, entity)
- 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 stream_one_chunk
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def stream_one_chunk
loop do
break if @connection.closed?
unless @grid_io.eof?
if @connection.get_outbound_data_size > BACKPRESSURE_LEVEL
- 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_sync
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def new_sync(agent)
::Alert.where(:enabled => true, :action => 'SYNC').each do |alert|
# skip non matching agents
next unless match_path(alert, 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 generate_certificates_anon
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def generate_certificates_anon
trace :info, "Generating anon 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 create
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def create
require_auth_level :tech
require_auth_level :tech_factories
# need a path to put the factory
- 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"