Showing 7,361 of 22,177 total issues
Method exec_cmd
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exec_cmd(sql, cmd, d)
boundary = rand_text_alphanumeric(8)
method = datastore['METHOD'] ? "VbBusObj.VbBusObjCls.GetRecordset" : "AdvancedDataFactory.Query"
dsn = Rex::Text.to_unicode(d)
if (d =~ /driver=\{SQL Server\}/)
Method exploit
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exploit
print_status("Access login page")
res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri(uri),
Method initialize
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Linux BPF Sign Extension Local Privilege Escalation',
Method initialize
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'SolarView Compact unauthenticated remote command execution vulnerability.',
Method initialize
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Artica Proxy Unauthenticated PHP Deserialization Vulnerability',
Method exploit
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exploit
vprint_status('Recovering the staging key...')
@staging_key ||= get_staging_key
if @staging_key.nil?
fail_with(Failure::Unknown, 'Failed to recover the staging key')
Method escalate_or_deescalate_privs
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def escalate_or_deescalate_privs(deescalate: false)
# Establish some variables based on if we need to escalate or deescalate privileges
if deescalate
use_filesystem = @role_to_add != 'ROLE_FILESYSTEM_EDITOR'
mode = 'cleanup'
Method initialize
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Redis Lua Sandbox Escape',
Method default_dispatch_request
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def default_dispatch_request(client, data)
return if data.strip.empty? || data.strip.nil?
processed_pdu_data = {
ip: client.peerhost,
Method build_unirpc_message
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_unirpc_message(
version_byte: 0x6c,
other_version_byte: 0x01,
body_length_override: nil,
Similar blocks of code found in 2 locations. Consider refactoring. Open
case rtype
when 0x21
rcnt = bits.slice!(0,1).unpack("C")[0]
1.upto(rcnt) do
tname = bits.slice!(0,15).gsub(/\x00.*/, '').strip
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 112.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
case rtype
when 0x21
rcnt = buff.slice!(0,1).unpack("C")[0]
1.upto(rcnt) do
tname = buff.slice!(0,15).gsub(/\x00.*/, '').strip
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 112.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method setup
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup
print_status("Setup")
@init_js = ::Rex::Exploitation::Js::Detect.os(<<-ENDJS
Method initialize
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Jenkins cli Ampersand Replacement Arbitrary File Read',
Method getprocesslist
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getprocesslist(rhost)
print_status("#{rhost}:#{rport} [SAP] Connecting to SAP Management Console SOAP Interface ")
success = false
soapenv = 'http://schemas.xmlsoap.org/soap/envelope/'
Method get_start_profile
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_start_profile(rhost)
print_status("#{rhost}:#{rport} [SAP] Connecting to SAP Management Console SOAP Interface")
success = false
soapenv ='http://schemas.xmlsoap.org/soap/envelope/'
xsi ='http://www.w3.org/2001/XMLSchema-instance'
Method run_host
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_host(_ip)
@tries = 0
service_data = {
address: rhost,
Method run
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
domain = datastore['DOMAIN']
uri = datastore['TARGETURI']
exchange_version = datastore['EXCHANGE_VERSION']
Method initialize
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
merge_info(
info,
'Name' => 'Process Herpaderping evasion technique',
Method initialize
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'MaraCMS Arbitrary PHP File Upload',