Showing 10 of 12 total issues
Class Shell
has 60 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Shell < Resource
# Persistent environment variables for the shell.
#
# @return {Hash{String => String}]
Class RPCSession
has 50 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class RPCSession < Session
# The RPC client object.
#
# @return [#call]
Class SystemShell
has 44 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class SystemShell < Core::CLI::CommandShell
shell_name 'ronin-post_ex'
#
Class ShellSession
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class ShellSession < Session
# The IO object used to communicate with the shell.
#
# @return [Socket, IO]
File system_shell.rb
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'ronin/core/cli/command_shell'
require_relative 'shell_shell'
require_relative '../remote_file'
Class FS
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class FS < Resource
#
# Gets the current working directory.
#
File shell.rb
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require_relative '../resource'
require_relative '../cli/shell_shell'
require 'date'
Method initialize
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def initialize(session, path: nil, fd: nil)
if path
unless session.respond_to?(:fs_stat)
raise(NotImplementedError,"#{session.inspect} does not define #fs_stat")
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 initialize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(session, path: nil, fd: nil)
if path
unless session.respond_to?(:fs_stat)
raise(NotImplementedError,"#{session.inspect} does not define #fs_stat")
end
Method shell_exec
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def shell_exec(command)
shell_puts("echo #{DELIMINATOR}; #{command} 2>/dev/null | base64; echo #{DELIMINATOR}")
# consume any leading output before the command output
while (line = shell_gets)
- 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"