Showing 7,361 of 22,177 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
def exploit
if is_system?
fail_with(Failure::None, 'Session is already elevated')
end
- 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 82.
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 initialize(info = {})
super(update_info(info,
'Name' => 'Apple TV Image Remote Control',
'Description' => %q(
This module will show an image on an AppleTV device for a period of time.
- 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 82.
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 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Object run() throws Exception
{
//System.out.println("Running");
// if the native payload data has not been set just return for now, it
// will be set by the next time we reach here.
Method run
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Object run() throws Exception
{
//System.out.println("Running");
// if the native payload data has not been set just return for now, it
// will be set by the next time we reach here.
Method view_site_tree
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def view_site_tree(urlstr, md, ld)
if !urlstr
return
end
Method rpc_mon_nodes
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rpc_mon_nodes
# Pretty monitor
color = begin
opts['ConsoleDriver'].output.supports_color?
Method on_dispatch_request
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_dispatch_request(client, data)
return if data.strip.empty?
data.extend(Net::BER::Extensions::String)
begin
Method initialize
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Python Flask Cookie Signer',
Method srvsvc_netshareenum
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def srvsvc_netshareenum
shares = []
handle = dcerpc_handle('4b324fc8-1670-01d3-1278-5a47bf6ee188', '3.0', 'ncacn_np', ["\\srvsvc"])
begin
Method initialize
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Windows Registry Security Descriptor Utility',
Method run
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
connect_login
modprops = ['attendee', 'categories', 'class', 'created', 'description',
Method run_host
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_host(ip)
if session
set_mssql_session(session.client)
elsif !mssql_login(datastore['USERNAME'], datastore['PASSWORD'])
info = self.mssql_client.initial_connection_info
Method initialize
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
super(
'Name' => 'Log4Shell HTTP Scanner',
'Description' => %q{
Versions of Apache Log4j2 impacted by CVE-2021-44228 which allow JNDI features used in configuration,
Method run_host
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_host(ip)
tpath = normalize_uri(datastore['PATH'])
if tpath[-1,1] != '/'
tpath += '/'
Method run_host
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_host(ip)
vprint_status("#{ip}:#{rport} - Starting ACPP login sweep")
cred_collection = Metasploit::Framework::PrivateCredentialCollection.new(
blank_passwords: datastore['BLANK_PASSWORDS'],
Method run_host
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_host(ip)
unless requires_password?(ip)
print_good "#{peer} - No password is required."
report_vuln(
host: ip,
Method initialize
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(update_info(info,
'Name' => 'PhpMyAdmin Config File Code Injection',
'Description' => %q{
This module exploits a vulnerability in phpMyAdmin's setup
Method initialize
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(update_info(info,
'Name' => 'Webmin Upload Authenticated RCE',
'Description' => %q(
This module exploits an arbitrary command execution vulnerability in Webmin
Method initialize
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(update_info(info,
'Name' => 'FusionPBX Operator Panel exec.php Command Execution',
'Description' => %q{
This module exploits an authenticated command injection vulnerability
Method initialize
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(update_info(info,
'Name' => 'MoinMoin twikidraw Action Traversal File Upload',
'Description' => %q{
This module exploits a vulnerability in MoinMoin 1.9.5. The vulnerability