File vcenter_forge_saml_token.rb
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'metasploit/framework/credential_collection'
class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::WmapScanUniqueQuery
include Msf::Exploit::Remote::HttpClient
Method initialize
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'VMware vCenter Forge SAML Authentication Credentials',
Method submit_vcenter_auth
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def submit_vcenter_auth(xml)
saml_response = Base64.strict_encode64(xml)
if @vcenter_saml_relay_state
res = send_request_cgi({
Method validate_idp_options
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def validate_idp_options
begin
idp_cert_file = File.binread(vc_idp_cert)
idp_key_file = File.binread(vc_idp_key)
vmca_cert_file = File.binread(vc_vmca_cert)
- 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 sign_vcenter_saml
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sign_vcenter_saml(xml)
xmldoc = Nokogiri::XML(xml) do |config|
config.options = Nokogiri::XML::ParseOptions::STRICT | Nokogiri::XML::ParseOptions::NONET
end
Method submit_vcenter_auth
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def submit_vcenter_auth(xml)
saml_response = Base64.strict_encode64(xml)
if @vcenter_saml_relay_state
res = send_request_cgi({
- 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 init_vsphere_login
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def init_vsphere_login
res = send_request_cgi({
'uri' => '/ui/login',
'method' => 'GET'
})
Method validate_idp_options
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate_idp_options
begin
idp_cert_file = File.binread(vc_idp_cert)
idp_key_file = File.binread(vc_idp_key)
vmca_cert_file = File.binread(vc_vmca_cert)
Method init_vsphere_login
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def init_vsphere_login
res = send_request_cgi({
'uri' => '/ui/login',
'method' => 'GET'
})
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def run
cookie_jar.clear
validate_domains
validate_timestamps
- 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"