Method run
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def run
group_path = 'MACHINE\\Preferences\\Groups\\Groups.xml'
group_path_user = 'USER\\Preferences\\Groups\\Groups.xml'
service_path = 'MACHINE\\Preferences\\Services\\Services.xml'
printer_path = 'USER\\Preferences\\Printers\\Printers.xml'
- 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 gpp.rb
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
class MetasploitModule < Msf::Post
include Msf::Auxiliary::Report
include Msf::Post::File
include Msf::Post::Windows::ExtAPI
include Msf::Post::Windows::Priv
Method run
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
group_path = 'MACHINE\\Preferences\\Groups\\Groups.xml'
group_path_user = 'USER\\Preferences\\Groups\\Groups.xml'
service_path = 'MACHINE\\Preferences\\Services\\Services.xml'
printer_path = 'USER\\Preferences\\Printers\\Printers.xml'
Method get_basepaths
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_basepaths(base, cached = false)
locals = []
begin
session.fs.dir.foreach(base) do |sub|
next if sub =~ /^(\.|\.\.)$/
- 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 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Windows Gather Group Policy Preference Saved Passwords',
Method gpp_xml_file
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def gpp_xml_file(path)
data = read_file(path)
spath = path.split('\\')
retobj = {
- 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_domain_reg
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_domain_reg
locations = []
# Lots of redundancy but hey this is quick!
locations << ['HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\', 'Domain']
locations << ['HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\', 'DefaultDomainName']
- 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"