Showing 7,361 of 22,177 total issues
Method generate
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate(opts={})
cmd = datastore['CMD'] || ''
nullfreeversion = datastore['NullFreeVersion']
if cmd.empty?
Method exploit
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exploit
# Forge the payload
name = ".#{Rex::Text.rand_text_alpha(4)}"
files =
[
Method get_phpinfo
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_phpinfo
# uses the Magento_Framework_DB_Transaction class
serialize = 'O:13:\"Credis_Client\":22:{'
serialize << 's:8:\"\u0000*\u0000redis\";'
serialize << 'O:45:\"Magento\\\Sales\\\Model\\\Order\\\Payment\\\Transaction\":40:{'
Method initialize
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Gogs Git Hooks Remote Code Execution',
Similar blocks of code found in 2 locations. Consider refactoring. Open
def create_payload(num)
command = ""
os = "ANYOS"
if datastore['OS'].downcase == "linux"
if num == 1
- 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 137.
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
def create_payload(num)
command = ""
os = "ANYOS"
if datastore['OS'].downcase == "linux"
if num == 1
- 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 137.
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 run
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
cracker = new_password_cracker(action.name)
lookups = []
Method make_kex_init
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
def make_kex_init
[0x00, 0x00, 0x03, 0x14, 0x08, 0x14, 0xff, 0x9f,
0xde, 0x5d, 0x5f, 0xb3, 0x07, 0x8f, 0x49, 0xa7,
0x79, 0x6a, 0x03, 0x3d, 0xaf, 0x55, 0x00, 0x00,
0x00, 0x7e, 0x64, 0x69, 0x66, 0x66, 0x69, 0x65,
Method get_phpshell
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_phpshell
s = "#{@webroot}/#{@backdoor}"
p = "<?php #{payload.encoded} ?>"
# uses the Magento_Framework_Simplexml_Config_Cache_File class
serialize = 'O:13:\"Credis_Client\":22:{'
Method initialize
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'SaltStack Salt API Unauthenticated RCE through wheel_async client',
Method decrypt_vbr_db
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
def decrypt_vbr_db(csv_dataset)
current_row = 0
decrypted_rows = 0
plaintext_rows = 0
blank_rows = 0
Method digest_auth
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
def digest_auth(opts={})
cnonce = make_cnonce
nonce_count = 0
to = opts['timeout'] || 20
Method cmd_download
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cmd_download(*args)
if (args.empty? or args.include? "-h")
cmd_download_help
return true
end
Method report_note
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
def report_note(opts)
return if not active
::ApplicationRecord.connection_pool.with_connection {
wspace = Msf::Util::DBManager.process_opts_workspace(opts, framework)
opts = opts.clone()
Method process_propfind
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_propfind(cli, request)
path = request.uri
print_status("PROPFIND #{path}")
body = ''
Method run_host
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_host(ip)
vprint_status('Attempting user enumeration')
res = send_request_cgi(
'uri' => normalize_uri(target_uri.path, 'api', 'index.php', 'v1', 'users'),
'headers' => {
Method upload_payload
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upload_payload
uri = target_uri.path
@filename = rand_text_alpha(8+rand(8)) + ".cfm" #numbers is a bad idea
taskname = rand_text_alpha(8+rand(8)) #numbers is a bad idea
Method initialize
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Atlassian Confluence WebWork OGNL Injection',
Method initialize
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'FreeBSD ip6_setpktopt Use-After-Free Privilege Escalation',
Method on_request_uri
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_request_uri(cli, request)
agent = request['User-Agent']
case request['User-Agent']
when /MSIE.*Windows NT 5\.1.*\.NET CLR .*/