Showing 112 of 173 total issues
Method set_snmpv3_service
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_snmpv3_service(authentication_type = Credential::AuthenticationType::NOAUTH, username = nil, password = nil, privacy_type = Credential::PrivacyType::NOPRIV, privacy_password = nil)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, address, site_id, risk_factor = 1.0, risk_score = 0.0)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(name, baseURL, soft403Pattern, id = -1, enabled = true)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(start = 0, stop = 0, fail = 0, resume = 0, pause = 0)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(live, dead, filtered, unresolved, other)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(name, value, type, dynamic, checked)
Method execute
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.execute(url, req, api_version = '1.1', options = {}, trust_store = nil)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, name, description = nil, risk_factor = 1.0, risk_score = 0.0)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, name, desc, risk, dynamic)
Method set_ssh_service
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_ssh_service(username = nil, password = nil, elevation_type = nil, elevation_user = nil, elevation_password = nil)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(type, interval, start, enabled = true, scan_template_id = nil)
Method post
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def post(nsc, uri, payload = nil, content_type = CONTENT_TYPE::XML, timeout = nil)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, config_id, status, generated_on, uri)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(name, full_name, id = -1, enabled = true, scope = Scope::SILO)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(template_id, format, site_id = nil, owner = nil, time_zone = nil)
Method load
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.load(connection, id)
xml = '<EngineConfigRequest session-id="' + connection.session_id + '"'
xml << %( engine-id="#{id}")
xml << ' />'
r = connection.execute(xml, '1.2')
- 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
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.parse(json)
color = json['attributes'].find { |attr| attr['tag_attribute_name'] == 'COLOR' }
color = color['tag_attribute_value'] if color
source = json['attributes'].find { |attr| attr['tag_attribute_name'] == 'SOURCE' }
source = source['tag_attribute_value'] if source
- 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 db_maintenance
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def db_maintenance(clean_up = false, compress = false, reindex = false)
return unless compress || clean_up || reindex
parameters = { 'cmd' => 'startMaintenance', 'targetTask' => 'dbMaintenance' }
parameters['cleanup'] = 1 if clean_up
parameters['compress'] = 1 if compress
- 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 include?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def include?(single_ip)
return false unless single_ip.respond_to? :from
from = IPAddr.new(@from)
to = @to.nil? ? from : IPAddr.new(@to)
other = IPAddr.new(single_ip)
- 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 validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate
raise ArgumentError.new('Name is a required attribute.') unless @name
raise ArgumentError.new('Scan filter is a required attribute.') unless @scan_filter
raise ArgumentError.new('Vuln filter is a required attribute.') unless @vuln_filter
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"