File manageengine_password_manager_creds.rb
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
class MetasploitModule < Msf::Post
include Msf::Post::File
include Msf::Post::Process
Method run
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def run
install_path = datastore['INSTALL_PATH'].blank? ? detect_install_path : datastore['INSTALL_PATH']
unless install_path
fail_with(Failure::BadConfig,
'Unable to detect the PMP installation path. Use the INSTALL_PATH option instead.')
- 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 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Linux Gather ManageEngine Password Manager Pro Password Extractor',
Method detect_service
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def detect_service
# Check if PMP is installed as a service. The default Linux installer
# just create a symlink to the `pmp-service` service script in `/etc/init.d/`.
vprint_status('Trying to detect path from the PMP service')
Method get_db_enc_key
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_db_enc_key(install_path)
vprint_status('Getting the database encryption key')
manage_key_conf_path = "#{install_path}/#{MANAGE_KEY_CONF_PATH}"
begin
Method run
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
install_path = datastore['INSTALL_PATH'].blank? ? detect_install_path : datastore['INSTALL_PATH']
unless install_path
fail_with(Failure::BadConfig,
'Unable to detect the PMP installation path. Use the INSTALL_PATH option instead.')
Method detect_service
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def detect_service
# Check if PMP is installed as a service. The default Linux installer
# just create a symlink to the `pmp-service` service script in `/etc/init.d/`.
vprint_status('Trying to detect path from the PMP service')
- 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_db_enc_key
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_db_enc_key(install_path)
vprint_status('Getting the database encryption key')
manage_key_conf_path = "#{install_path}/#{MANAGE_KEY_CONF_PATH}"
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
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return install_dir.join('/')