Method parse_connections
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def parse_connections(connection_data)
doc = REXML::Document.new(connection_data)
# Process all of the server records
doc.elements.each('//server') do |server|
- 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 run
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def run
if is_system?
uid = session.sys.config.getuid
print_warning("This module is running under #{uid}.")
print_warning('Automatic decryption of encrypted passwords will not be possible.')
- 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 extract_password
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def extract_password(object)
if object.name == 'server'
logon_creds = object.elements['logonCredentials']
elsif object.elements['properties'] && object.elements['properties'].elements['logonCredentials']
logon_creds = object.elements['properties'].elements['logonCredentials']
- 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 initialize
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Windows Gather Remote Desktop Connection Manager Saved Password Extraction',
Method parse_connections
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_connections(connection_data)
doc = REXML::Document.new(connection_data)
# Process all of the server records
doc.elements.each('//server') do |server|
Method run
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
if is_system?
uid = session.sys.config.getuid
print_warning("This module is running under #{uid}.")
print_warning('Automatic decryption of encrypted passwords will not be possible.')
Method register_creds
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def register_creds(host_ip, user, pass, realm, port)
# Note that entries added by hostname instead of IP will not
# generate complete records. See discussion here:
# https://github.com/rapid7/metasploit-framework/pull/3599#issuecomment-51710319
Method register_creds
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def register_creds(host_ip, user, pass, realm, port)
Method decrypt_password
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def decrypt_password(data)
session.railgun.add_dll('crypt32') unless session.railgun.get_dll('crypt32')
pid = client.sys.process.getpid
process = client.sys.process.open(pid, PROCESS_ALL_ACCESS)
- 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"