Showing 31 of 31 total issues
File packet.rb
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'openssl'
require 'rex/text'
module Metasploit
module Aggregator
File aggregator.rb
has 421 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'socket'
require 'openssl'
require 'thread'
require 'securerandom'
Method process_tlv
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def process_tlv
while true
begin
request, payload = @tlv_queue.pop
if request.body && request.body.length > 0
- 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 process
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def process(responses)
requests = EnumeratorQueue.new(self)
uuid = nil
requestingThread = Thread.new do
- 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 process_requests
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_requests
while true do
begin
request_task = @queue.pop
Method process_requests
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def process_requests
while true do
begin
request_task = @queue.pop
- 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 process_tlv
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_tlv
while true
begin
request, payload = @tlv_queue.pop
if request.body && request.body.length > 0
Method get_data
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.get_data(connection, guaranteed_length)
checked_first = has_length = guaranteed_length
content_length = 0
request_lines = []
- 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 from_r
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def from_r(raw)
self.value = nil
length, self.type = raw.unpack("NN");
- 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 inspect
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def inspect
utype = type ^ TLV_META_TYPE_COMPRESSED
group = false
meta = case (utype & TLV_META_MASK)
when TLV_META_TYPE_STRING; "STRING"
Method process
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process(responses)
requests = EnumeratorQueue.new(self)
uuid = nil
requestingThread = Thread.new do
Method from_r
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def from_r(raw)
self.value = nil
length, self.type = raw.unpack("NN");
Method to_r
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def to_r
# Forcibly convert to ASCII-8BIT encoding
raw = value.to_s.unpack("C*").pack("C*")
if (self.type & TLV_META_TYPE_STRING == TLV_META_TYPE_STRING)
- 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 inspect
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def inspect
utype = type ^ TLV_META_TYPE_COMPRESSED
group = false
meta = case (utype & TLV_META_MASK)
when TLV_META_TYPE_STRING; "STRING"
- 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 connection_details
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def connection_details(payload)
detail_map = {}
details = @details_cache.session_details(payload)
unless details.nil?
details.each_pair do |key, value|
- 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 reverse_route
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def reverse_route(uuid)
# this method is not ready for prime time yet as will not
# support multiple sessions properly, either need unique Queue
# for each session which can be identified on reverse or need
# pipeline request order to ensure all results are posted in order only
- 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 eval_tlv_enc
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def eval_tlv_enc(request)
# this is really expensive as we have to process every
# piece of information presented from the console to eval for enc requests
response = nil
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"
Further reading
Method flush_stale_sessions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def flush_stale_sessions
@forwarder_mutex.synchronize do
stale_sessions = []
@response_queues.each_pair do |payload, queue|
unless (queue.time + CONNECTION_TIMEOUT) > Time.now
- 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 initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(type, value = nil, compress=false)
@type = type
@compress = compress
if (value != 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 forward
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def forward(connection)
#forward input requests
request_obj = Metasploit::Aggregator::Http::SslResponder.get_data(connection, false)
uri = Metasploit::Aggregator::Http::Request.parse_uri(request_obj)
@forwarder_mutex.synchronize do
- 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"