lib/rex/post/meterpreter/extensions/stdapi/sys/registry.rb
Class Registry
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Registry
class << self
attr_accessor :client
end
File registry.rb
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'rex/post/process'
require 'rex/post/meterpreter/packet'
require 'rex/post/meterpreter/client'
require 'rex/post/meterpreter/extensions/stdapi/constants'
require 'rex/post/meterpreter/extensions/stdapi/stdapi'
Method key2str
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.key2str(key)
if (key == 'HKLM' or key == 'HKEY_LOCAL_MACHINE')
return HKEY_LOCAL_MACHINE
elsif (key == 'HKCU' or key == 'HKEY_CURRENT_USER')
return HKEY_CURRENT_USER
- 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 set_value_direct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def Registry.set_value_direct(root_key, base_key, name, type, data, perm = KEY_WRITE)
Avoid too many return
statements within this method. Open
Open
return HKEY_CURRENT_CONFIG
Avoid too many return
statements within this method. Open
Open
return HKEY_DYN_DATA
Avoid too many return
statements within this method. Open
Open
return HKEY_PERFORMANCE_DATA