File ssh_command_shell_bind.rb
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'metasploit/framework/ssh/platform'
require 'rex/post/channel'
require 'rex/post/meterpreter/channels/socket_abstraction'
module Msf::Sessions
Method create_server_channel
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def create_server_channel(params)
msf_channel = nil
mutex = Mutex.new
condition = ConditionVariable.new
timed_out = 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 create_client_channel
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_client_channel(params)
msf_channel = nil
mutex = Mutex.new
condition = ConditionVariable.new
opened = false
Method create_client_channel
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def create_client_channel(params)
msf_channel = nil
mutex = Mutex.new
condition = ConditionVariable.new
opened = 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 create_server_channel
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_server_channel(params)
msf_channel = nil
mutex = Mutex.new
condition = ConditionVariable.new
timed_out = false
Method create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create(params)
# Notify handlers before we create the socket
notify_before_socket_create(self, params)
if params.proto == 'tcp'
- 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"