Showing 22,177 of 22,177 total issues
Method get_version_info_impl
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def get_version_info_impl
if session.type == 'meterpreter'
result = session.railgun.ntdll.RtlGetVersion(input_os_version_info_ex)
os_version_info_ex = unpack_version_info(result['VersionInformation'])
major = os_version_info_ex[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
File get_user_spns.py
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# modules
dependencies_missing = False
File drupal_drupageddon.rb
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
File trackit_file_upload.rb
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::EXE
Method frfxdmp
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
def frfxdmp(usrnm)
sitesvisited = []
dnldsmade = []
bkmrks = []
cookies = []
Method run
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
# check if we already have a socket, if not, create one
unless @sock
# create a socket
res_code, sock_or_msg = create_socket_for_xnode(rhost, rport)
Method run
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
# check if we already have a socket, if not, create one
unless @sock
# create a socket
res_code, sock_or_msg = create_socket_for_xnode(rhost, rport)
File ui.rb
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rex/post/meterpreter'
require 'rex/post/meterpreter/extensions/stdapi/command_ids'
module Rex
module Post
Method create_library
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.create_library(constant_manager, library_path = 'libc.dylib')
lib = Library.new(library_path, constant_manager)
lib.add_function(
'calloc',
Method run
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
host = datastore['HOST']
port = datastore['PORT']
local_host = datastore['SRVHOST']
local_port = datastore['SRVPORT']
Method run
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
print_status('Attempting to leak the password of the admin user...')
res = send_request_cgi(
'uri' => '/setup.cgi',
'method' => 'GET',
Method run
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
def check_results(passwords, results, hash_type, method)
passwords.each do |password_line|
password_line.chomp!
next if password_line.blank?
Method mount_internal_database
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
def mount_internal_database
# use cve-2023-39265 bypass to mount superset's internal sqlite db
res = send_request_cgi(
'uri' => normalize_uri(target_uri.path, 'api', 'v1', 'database/'),
'method' => 'POST',
Class WmapCommandDispatcher
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class WmapCommandDispatcher
# @!attribute wmapmodules
# @return [Array] Enabled WMAP modules
# @!attribute targets
Class MetasploitModule
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::Tcp
include Msf::Auxiliary::Scanner
include Msf::Auxiliary::Report
Class Core
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class Console::CommandDispatcher::Core
include Console::CommandDispatcher
#
Class RPC_Module
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class RPC_Module < RPC_Base
# Returns a list of exploit names. The 'exploit/' prefix will not be included.
#
# @return [Hash] A list of exploit names. It contains the following key:
File adobe_cooltype_sing.rb
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'zlib'
class MetasploitModule < Msf::Exploit::Remote
Rank = GreatRanking # aslr+dep bypass, js heap spray, rop, stack bof
Similar blocks of code found in 2 locations. Consider refactoring. Open
def run
return if not check_dependencies
name = Rex::Text.rand_text_alpha_upper(rand(10) + 1)
rand1 = Rex::Text.rand_text_alpha_upper(rand(10) + 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 162.
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 run
return if not check_dependencies
name = Rex::Text.rand_text_alpha_upper(rand(10) + 1)
rand1 = Rex::Text.rand_text_alpha_upper(rand(10) + 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 162.
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