Class Post
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class Post
module Vcenter
module Vcenter
include Msf::Post::File
include Msf::Post::Linux::Priv
Method get_aes_keys
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def get_aes_keys(base_fqdn, vc_psc_fqdn, base_dn, bind_dn, shell_bind_pw)
return nil unless command_exists? ldapsearch_bin
# this may error,
header = 'vmwSTSTenantKey: '
- 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 vcenter.rb
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Msf
class Post
module Vcenter
module Vcenter
include Msf::Post::File
Method get_idp_keys
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def get_idp_keys(base_fqdn, vc_psc_fqdn, base_dn, bind_dn, shell_bind_pw)
return nil unless command_exists? ldapsearch_bin
header = 'vmwSTSPrivateKey:: '
legacy_key_file = '/etc/vmware-sso/keys/ssoserverSign.key'
- 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_idp_certs
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def get_idp_certs(base_fqdn, vc_psc_fqdn, base_dn, bind_dn, shell_bind_pw)
return nil unless command_exists? ldapsearch_bin
header = 'userCertificate:: '
legacy_cert_file = '/etc/vmware-sso/keys/ssoserverSign.crt'
- 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_vecs_entries
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_vecs_entries(vecs_store)
return nil unless command_exists? vecs_bin
out = cmd_exec("#{vecs_bin} entry list --store #{vecs_store}")
return nil if out.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 process_vcdb_properties_file
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def process_vcdb_properties_file(location = vcd_properties_file)
return nil unless file_exist?(location)
contents = read_file(location)
return nil if contents.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 get_aes_keys
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_aes_keys(base_fqdn, vc_psc_fqdn, base_dn, bind_dn, shell_bind_pw)
return nil unless command_exists? ldapsearch_bin
# this may error,
header = 'vmwSTSTenantKey: '
Method get_idp_keys
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_idp_keys(base_fqdn, vc_psc_fqdn, base_dn, bind_dn, shell_bind_pw)
return nil unless command_exists? ldapsearch_bin
header = 'vmwSTSPrivateKey:: '
legacy_key_file = '/etc/vmware-sso/keys/ssoserverSign.key'
Method get_idp_certs
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_idp_certs(base_fqdn, vc_psc_fqdn, base_dn, bind_dn, shell_bind_pw)
return nil unless command_exists? ldapsearch_bin
header = 'userCertificate:: '
legacy_cert_file = '/etc/vmware-sso/keys/ssoserverSign.crt'
Method get_vecs_entries
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_vecs_entries(vecs_store)
return nil unless command_exists? vecs_bin
out = cmd_exec("#{vecs_bin} entry list --store #{vecs_store}")
return nil if out.nil?
Method get_ldif_contents
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_ldif_contents(base_fqdn, vc_psc_fqdn, base_dn, bind_dn, shell_bind_pw)
Method get_idp_keys
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_idp_keys(base_fqdn, vc_psc_fqdn, base_dn, bind_dn, shell_bind_pw)
Method get_aes_keys
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_aes_keys(base_fqdn, vc_psc_fqdn, base_dn, bind_dn, shell_bind_pw)
Method get_idp_certs
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_idp_certs(base_fqdn, vc_psc_fqdn, base_dn, bind_dn, shell_bind_pw)
Method get_ldif_contents
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_ldif_contents(base_fqdn, vc_psc_fqdn, base_dn, bind_dn, shell_bind_pw)
temp_ldif_file = "/tmp/.#{base_fqdn}_#{Time.now.strftime('%Y%m%d%H%M%S')}.tmp"
rm_f(temp_ldif_file) if file_exist?(temp_ldif_file)
out = cmd_exec("#{ldapsearch_bin} -h #{vc_psc_fqdn} -b '#{base_dn}' -s sub -D '#{bind_dn}' -w #{shell_bind_pw} \\* \\+ \\- \> #{temp_ldif_file}")
return nil unless file_exist?(temp_ldif_file)
- 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"