lib/rex/post/meterpreter/extensions/stdapi/railgun/util.rb
File util.rb
has 392 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'rex/post/meterpreter/extensions/stdapi/railgun/library_helper'
module Rex
module Post
module Meterpreter
Class Util
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Util
# Bring in some useful string manipulation utility functions
include LibraryHelper
Method sizeof_type
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
def sizeof_type(type)
if is_pointer_type?(type)
return pointer_size
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 sizeof_type
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def sizeof_type(type)
if is_pointer_type?(type)
return pointer_size
end
Avoid too many return
statements within this method. Open
Open
return PRIMITIVE_TYPE_SIZES[primitive]
Avoid too many return
statements within this method. Open
Open
return raw.unpack('V').first == 1
Avoid too many return
statements within this method. Open
Open
return raw.unpack('V').first
Avoid too many return
statements within this method. Open
Open
return raw
Avoid too many return
statements within this method. Open
Open
return pointer_size