Showing 16,065 of 22,177 total issues
Method cmd_record_mic
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def cmd_record_mic(*args)
path = Rex::Text.rand_text_alpha(8) + ".wav"
play = true
duration = 1
- 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_getsystem
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def cmd_getsystem( *args )
technique = ELEVATE_TECHNIQUE_ANY
desc = ""
- 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 expand_path
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def File.expand_path(path)
case client.platform
when 'osx', 'freebsd', 'bsd', 'linux', 'android', 'apple_ios'
# For unix-based systems, do some of the work here
# First check for ~
- 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 deeply nested control flow statements. Open
if buffer_size != 4
raise "Please pass 4 for 'out' PULONG_PTR, since they require a buffer of size 4"
end
Method search
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def File.search( root=nil, glob="*.*", recurse=true, timeout=-1, modified_start_date=nil, modified_end_date=nil)
Method download
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def Dir.download(dst, src, opts = {}, force = true, glob = nil, &stat)
Method add_function
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_function(lib_name, function_name, return_type, params, remote_name=nil, calling_conv='stdcall')
Method play_file
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def play_file(path)
raise "Could not read file: #{path}" unless ::File.readable?(path) && ::File.file?(path)
channel = Channel.create(client, 'audio_output', Rex::Post::Meterpreter::Channels::Pools::StreamPool, CHANNEL_FLAG_SYNCHRONOUS)
- 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 check_params
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_params(params)
params.each do |param|
raise ArgumentError, "each param must be described by a three-tuple [type,name,direction]" unless param.length == 3
type = param[0]
direction = param[2]
- 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
def Registry.set_value_direct(root_key, base_key, name, type, data, perm = KEY_WRITE)
Method create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def Channel.create(client, type = nil, klass = nil,
flags = CHANNEL_FLAG_SYNCHRONOUS, addends = nil, **klass_kwargs)
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(host, port, socket, conn_timeout, read_timeout, write_timeout)
Method value2net
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.value2net(v)
case v
when nil
type = Field::TYPE_NULL
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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(client, cid, type, flags, packet, **_)
Method parse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse(buffer)
super do
@field_type = buffer.read_byte
break if @field_type == 0
@field_values = []
- 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 log_packet_to_file
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def log_packet_to_file(packet, packet_type)
pathname = ::Pathname.new(self.tlv_log_file_path.split('file:').last)
begin
if self.tlv_log_file.nil? || self.tlv_log_file.path != pathname.to_s
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(client, cid, type, flags, packet, **_)
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(client, cid, type, flags, packet, **_)
Method query
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def query(sql)
write_message(Query.new(sql))
result = Result.new
errors = []
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(client, cid, type, flags, packet, **_)