Method run
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def run
type = datastore['METHOD']
remote = datastore['TARGET']
thread_num = datastore['THREADS']
proto = datastore['PROTOCOL']
- 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 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
type = datastore['METHOD']
remote = datastore['TARGET']
thread_num = datastore['THREADS']
proto = datastore['PROTOCOL']
Method initialize
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Generate TCP/UDP Outbound Traffic On Multiple Ports',
Method egress
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def egress(type, proto, remote, dport, num, gw)
Method native_init_connect
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def native_init_connect(proto, ip, port, num, gw)
vprint_status("[#{num}:NATIVE] Connecting to #{ip} port #{proto}/#{port}")
if proto == 'TCP'
begin
Rex::Socket::Tcp.create(
- 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 egress
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def egress(type, proto, remote, dport, num, gw)
if type == 'WINAPI'
if proto == 'ALL'
winapi_egress_to_port('TCP', remote, dport, num)
winapi_egress_to_port('UDP', remote, dport, num)
- 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 native_init_connect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def native_init_connect(proto, ip, port, num, gw)