Class Channel
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Channel
# Class modifications to support global channel message
# dispatching without having to register a per-instance handler
class << self
include Rex::Post::Meterpreter::InboundPacketHandler
Method _read
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _read(length = nil, addends = nil)
if self.cid.nil?
raise IOError, "Channel has been closed.", caller
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 create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def Channel.create(client, type = nil, klass = nil,
flags = CHANNEL_FLAG_SYNCHRONOUS, addends = nil, **klass_kwargs)
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(client, cid, type, flags, packet, **_)
Method _write
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _write(buf, length = nil, addends = nil)
if self.cid.nil?
raise IOError, "Channel has been closed.", caller
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 finalize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.finalize(client, cid)
proc {
unless cid.nil?
deferred_close_proc = proc do
begin
- 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"