Method process_db
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_db(db_path, user)
db = SQLite3::Database.new(db_path)
# Extract information for accounts configured in Skype
print_status('Enumerating accounts')
Method run
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def run
# syinfo is only on meterpreter sessions
print_status("Running Skype enumeration against #{sysinfo['Computer']}") if !sysinfo.nil?
# Ensure that SQLite3 gem is installed
- 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 skype_enum.rb
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'csv'
class MetasploitModule < Msf::Post
include Msf::Post::File
include Msf::Post::Windows::UserProfiles
Method download_db
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def download_db(profile)
if session.type == 'meterpreter'
if session.platform == 'osx'
file = session.fs.file.search("#{profile['dir']}/Library/Application Support/Skype/", 'main.db', true)
else
- 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 download_db
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def download_db(profile)
if session.type == 'meterpreter'
if session.platform == 'osx'
file = session.fs.file.search("#{profile['dir']}/Library/Application Support/Skype/", 'main.db', true)
else
Method initialize
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Multi Gather Skype User Data Enumeration',
Method process_db
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def process_db(db_path, user)
db = SQLite3::Database.new(db_path)
# Extract information for accounts configured in Skype
print_status('Enumerating accounts')
- 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
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
# syinfo is only on meterpreter sessions
print_status("Running Skype enumeration against #{sysinfo['Computer']}") if !sysinfo.nil?
# Ensure that SQLite3 gem is installed