File sys.rb
has 1012 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rex/post/meterpreter'
require 'rex/post/meterpreter/extensions/stdapi/command_ids'
module Rex
module Post
Method cmd_reg
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
def cmd_reg(*args)
# Extract the command, if any
cmd = args.shift
if (args.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 cmd_reg
has 195 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cmd_reg(*args)
# Extract the command, if any
cmd = args.shift
if (args.length == 0)
Class Sys
has 44 methods (exceeds 20 allowed). Consider refactoring. Open
class Console::CommandDispatcher::Stdapi::Sys
Klass = Console::CommandDispatcher::Stdapi::Sys
include Console::CommandDispatcher
Method match_processes
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def match_processes(processes, args, quiet: false)
search_proc = nil
search_user = nil
exact_match = 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 cmd_shell
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def cmd_shell(*args)
use_pty = false
raw = false
sh_path = '/bin/bash'
- 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 match_processes
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def match_processes(processes, args, quiet: false)
search_proc = nil
search_user = nil
exact_match = false
Method cmd_execute
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cmd_execute(*args)
if (args.length == 0)
args.unshift("-h")
end
Method commands
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
def commands
all = {
'clearev' => 'Clear the event log',
'drop_token' => 'Relinquishes any active impersonation token.',
'execute' => 'Execute a command',
Method cmd_shell
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cmd_shell(*args)
use_pty = false
raw = false
sh_path = '/bin/bash'
Method cmd_suspend
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def cmd_suspend(*args)
# give'em help if they want it, or seem confused
if args.length == 0 or (args.include? "-h")
cmd_suspend_help
return true
- 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 pty_shell
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pty_shell(sh_path, raw: false)
args = ['-p']
if raw
args << '-r' if raw
Method pty_shell
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def pty_shell(sh_path, raw: false)
args = ['-p']
if raw
args << '-r' if raw
- 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 cmd_suspend
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cmd_suspend(*args)
# give'em help if they want it, or seem confused
if args.length == 0 or (args.include? "-h")
cmd_suspend_help
return true
Method cmd_pgrep
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def cmd_pgrep(*args)
f_flag = false
l_flag = false
@@pgrep_opts.parse(args) do |opt, idx, val|
- 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 cmd_pgrep
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cmd_pgrep(*args)
f_flag = false
l_flag = false
@@pgrep_opts.parse(args) do |opt, idx, val|
Method validate_pids
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def validate_pids(pids, allow_pid_0 = false, allow_session_pid = false)
return [] if (pids.class != Array or pids.empty?)
valid_pids = []
# to minimize network traffic, we only get host processes once
- 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 cmd_execute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def cmd_execute(*args)
if (args.length == 0)
args.unshift("-h")
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 cmd_reg_tabs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def cmd_reg_tabs(str, words)
if words.length == 1
return %w[enumkey createkey deletekey queryclass setval deleteval queryval] + @@reg_opts.option_keys
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 cmd_kill
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def cmd_kill(*args)
# give'em help if they want it, or seem confused
if ( args.length == 0 or (args.length == 1 and args[0].strip == "-h") )
cmd_kill_help
return true
- 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
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return @@reg_opts.option_keys
Avoid too many return
statements within this method. Open
return true
Avoid too many return
statements within this method. Open
return %w[REG_BINARY REG_DWORD REG_QWORD REG_DWORD_BIG_ENDIAN REG_EXPAND_SZ
REG_LINK REG_MULTI_SZ REG_NONE REG_RESOURCE_LIST REG_SZ]
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return true
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return %w[32 64]
Method cmd_ps_tabs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def cmd_ps_tabs(str, words)
return @@ps_opts.option_keys if words.length == 1
case words[-1]
when '-A'
- 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"