Method run_host
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def run_host(ip)
if datastore['RPORT'].blank? || datastore['RPORT'] == 0
smb_services = [
{ port: 445, direct: true },
{ port: 139, direct: false }
- 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_host
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_host(ip)
if datastore['RPORT'].blank? || datastore['RPORT'] == 0
smb_services = [
{ port: 445, direct: true },
{ port: 139, direct: false }
Method smb_proto_info
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def smb_proto_info
info = {
capabilities: {},
versions: []
}
- 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 smb_version.rb
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'recog'
class MetasploitModule < Msf::Auxiliary
# Exploit mixins should be called first
Method smb_proto_info
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def smb_proto_info
info = {
capabilities: {},
versions: []
}
Method smb_os_description
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def smb_os_description(res, nd_smb_fingerprint)
#
# Create the note hash for fingerprint.match
#
nd_fingerprint_match = {}
Method smb_os_description
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def smb_os_description(res, nd_smb_fingerprint)
#
# Create the note hash for fingerprint.match
#
nd_fingerprint_match = {}
- 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"