Showing 21,757 of 21,757 total issues
Avoid deeply nested control flow statements. Open
timeout = params["timeout"][0] if params.has_key? "timeout"
Method check_self_class
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_self_class
in_register = false
@lines.each do |line|
(in_register = true) if line =~ /^\s*register_(?:advanced_)?options/
(in_register = false) if line =~ /^\s*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 process_traps
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def process_traps(trap_listener)
@handler_init.call(trap_listener) if @handler_init
loop do
data, source_ip, source_port = @transport.recvfrom(@max_bytes)
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 parse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.parse(args)
options = {}
parser = OptionParser.new do |opt|
opt.banner = "Usage: #{__FILE__} [options]\nExample: #{__FILE__} -q Aa3A\n[*] Exact match at offset 9"
opt.separator ''
- 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 with_metadata
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def with_metadata(child, parents: [])
child = child.clone
if child[:folder]
parent_folders = parents.map { |page| page[:folder] }
- 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_path_for
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def new_path_for(old_path, old_path_anchor)
# Strip out any leading `./` or `/` before the relative path.
# This is needed for our later code that does additional filtering for
# potential ambiguity with absolute paths since those comparisons occur
# against filenames without the leading ./ and / parts.
- 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_boot_key
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_boot_key
return if !@hive.root_key
return if !@hive.root_key.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"
Further reading
Avoid deeply nested control flow statements. Open
maxpkts = params["maxpkts"][0] if params.has_key? "maxpkts"
Method trap_v1
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def trap_v1(enterprise, agent_addr, generic_trap, specific_trap, timestamp, object_list=[])
Method search
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def search(name,type=Net::DNS::A,cls=Net::DNS::IN)
# If the name contains at least one dot then try it as is first.
if name.include? "."
@logger.debug "Search(#{name},#{Net::DNS::RR::Types.new(type)},#{Net::DNS::RR::Classes.new(cls)})"
- 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 lmv2_user_session_key
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.lmv2_user_session_key(user, pass, domain, srv_chall, cli_chall, opt = {})
Method make_ntlmssp_blob_chall
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.make_ntlmssp_blob_chall(win_domain, win_name, dns_domain, dns_name, chall, flags)
Method on_def
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def on_def(node)
update_info_node = find_update_info_node(node) || find_nested_update_info_node(node)
return if update_info_node.nil?
unless begins_its_line?(update_info_node.source_range)
- 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 encrypt_ard
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.encrypt_ard(username, password, generator, key_length, prime_modulus, peer_public_key)
Method shell_command_synchronous
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def shell_command_synchronous(command, args, timeout)
start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
command_id = send_command(command, args)
buffer = []
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 check_for_required_keys
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_for_required_keys(notes)
last_key = nil
keys_present = []
notes.each_pair do |key, _value|
if REQUIRED_KEYS.include? key.value
- 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 stop
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def stop
ensure_close = [udp_sock, tcp_sock].compact
begin
listener_thread.kill if listener_thread.respond_to?(:kill)
self.listener_thread = 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 start
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def start
if serve_udp
@udp_sock = Rex::Socket::Udp.create(sock_options)
self.listener_thread = Rex::ThreadFactory.spawn('UDPLDAPServerListener', false) do
monitor_listener
- 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
Avoid deeply nested control flow statements. Open
if pub_info.length <= 2
auth_info[:domain], auth_info[:user] = pub_info
else
auth_info[:result_code] = Net::LDAP::ResultCodeInvalidCredentials
auth_info[:error_msg] = "Invalid LDAP Login Attempt => DN:#{user_login.name}"
Method recv_raw
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def recv_raw(timeout: @timeout)
remaining = timeout
frame_size, elapsed_time = Rex::Stopwatch.elapsed_time do
@conn.get_once(4, remaining)
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"