Showing 15,730 of 21,757 total issues
Method on_request_uri
has 303 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_request_uri(cli, request)
if request.uri =~ %r{/screenshot$}
data = ''
if supports_espia?(session)
data = session.espia.espia_image_get_dev_screen
Method run
has a Cognitive Complexity of 76 (exceeds 5 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?
- 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 vuln_version?
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
def vuln_version?(res)
# checks the model, firmware and hardware version
@d_link = { 'product' => nil, 'firmware' => nil, 'hardware' => nil, 'arch' => nil }
html = Nokogiri.HTML(res.body, nil, 'UTF-8')
- 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 openssl_heartbleed.rb
has 659 lines of code (exceeds 250 allowed). Consider refactoring. Open
class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::Tcp
include Msf::Auxiliary::Scanner
include Msf::Auxiliary::Report
Method exploit
has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring. Open
def exploit
# Display start time
time1 = Time.new
print_status("-------------------------------------------------")
print_status("Start time : #{time1.inspect}")
- 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 ms_dtyp.rb
has 656 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'bindata'
require 'ruby_smb'
require 'rex/proto/secauthz/well_known_sids'
module Rex::Proto::MsDtyp
File opennms_horizon_authenticated_rce.rb
has 651 lines of code (exceeds 250 allowed). Consider refactoring. Open
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
prepend Msf::Exploit::Remote::AutoCheck
Method check_lines
has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring. Open
def check_lines
url_ok = true
no_stdio = true
in_comment = false
in_literal = false
- 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 glassfish_deployer.rb
has 647 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'nokogiri'
require 'metasploit/framework/login_scanner/glassfish'
require 'metasploit/framework/credential_collection'
class MetasploitModule < Msf::Exploit::Remote
Class Exploit
has 77 methods (exceeds 20 allowed). Consider refactoring. Open
class Exploit < Msf::Module
##
# Exceptions
##
File resolver.rb
has 645 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'socket'
require 'timeout'
require 'ipaddr'
require 'logger'
require 'net/dns/packet'
File thycotic_secretserver_dump.rb
has 644 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'metasploit/framework/credential_collection'
class MetasploitModule < Msf::Post
include Msf::Post::Common
include Msf::Post::File
Method run
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
def run
# we have to overload the process_cracker_results from password_cracker.rb since LANMAN
# is a special case where we may need to do some combining
def process_cracker_results(results, cred)
return results if cred['core_id'].nil? # make sure we have good data
- 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 run_host
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
def run_host(ip)
#
# Max string len
#
- 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 run_host
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
def run_host(ip)
ports = [139, 445]
if session
print_status("Using existing session #{session.sid}")
- 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 generate
has 285 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate(_opts = {})
target_uri = datastore['URL'] || ""
filename = datastore['EXE'] || ""
proto = "https"
File android.rb
has 637 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rex/post/meterpreter'
require 'rex/post/meterpreter/extensions/android/command_ids'
require 'date'
module Rex
File client.rb
has 637 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rex/encoder/ndr'
require 'recog'
module Msf
module Exploit::Remote::SMB
File uds.rb
has 636 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Msf
class Post
module Hardware
module Automotive
Method code_execution
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
def code_execution
print_status("Trying code execution...")
# can't "${run{/bin/sh -c 'exec /bin/sh -i <&#{b} >&0 2>&0'}} " anymore:
# DW/26 Set FD_CLOEXEC on SMTP sockets after forking in the daemon, to ensure
- 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"