Method encode
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
def encode
# Get the minimum number of nops to use
min = (reqs['MinNops'] || 0).to_i
min = 0 if reqs['DisableNops']
- 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 encode
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
def encode
# Get the minimum number of nops to use
min = (reqs['MinNops'] || 0).to_i
min = 0 if reqs['DisableNops']
Method generate_sled
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def generate_sled
min = reqs['MinNops'] || 0
space = reqs['Space']
pad_nops = reqs['PadNops']
- 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 encoded_payload.rb
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Msf
###
#
# This class wrappers an encoded payload buffer and the means used to create
Method encoded_exe
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def encoded_exe(opts={})
# Ensure arch and platform are in the format that to_executable expects
if opts[:arch] and not opts[:arch].kind_of? Array
opts[:arch] = [ opts[:arch] ]
end
- 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 generate_sled
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_sled
min = reqs['MinNops'] || 0
space = reqs['Space']
pad_nops = reqs['PadNops']
Method generate
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def generate(raw = nil)
self.raw = raw
self.encoded = nil
self.nop_sled_size = 0
self.nop_sled = 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 generate
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate(raw = nil)
self.raw = raw
self.encoded = nil
self.nop_sled_size = 0
self.nop_sled = nil
Method encoded_exe
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def encoded_exe(opts={})
# Ensure arch and platform are in the format that to_executable expects
if opts[:arch] and not opts[:arch].kind_of? Array
opts[:arch] = [ opts[:arch] ]
end
Method has_chars?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def has_chars?(chars)
# NOTE: BadChars can contain whitespace, so don't use String#blank?
if chars.nil? || chars.empty?
return false
end
- 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"