File cracker.rb
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Metasploit
module Framework
module PasswordCracker
class PasswordCrackerNotFoundError < StandardError
end
Method jtr_format_to_hashcat_format
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
def jtr_format_to_hashcat_format(format)
case format
# nix
when 'md5crypt'
'500'
Method cracker_version
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def cracker_version
if cracker == 'john'
cmd = binary_path
elsif cracker == 'hashcat'
cmd = binary_path
- 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 hashcat_crack_command
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def hashcat_crack_command
cmd_string = binary_path
cmd = [cmd_string, '--session=' + cracker_session_id, '--logfile-disable', '--quiet', '--username']
if pot.present?
- 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 hashcat_crack_command
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def hashcat_crack_command
cmd_string = binary_path
cmd = [cmd_string, '--session=' + cracker_session_id, '--logfile-disable', '--quiet', '--username']
if pot.present?
Method john_crack_command
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def john_crack_command
cmd_string = binary_path
cmd = [cmd_string, '--session=' + cracker_session_id, john_nolog_format]
- 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 john_crack_command
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def john_crack_command
cmd_string = binary_path
cmd = [cmd_string, '--session=' + cracker_session_id, john_nolog_format]
Method binary_path
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def binary_path
# Always prefer a manually entered path
if cracker_path && ::File.file?(cracker_path)
return cracker_path
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 john_nolog_format
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def john_nolog_format
if /(\d{4}-\d{2}-\d{2})/ =~ cracker_version
# we lucked out and theres a date, we'll check its older than the commit that changed the nolog
if Date.parse(Regexp.last_match(1)) < Date.parse('2020-11-27')
return '--nolog'
- 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 show_command
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def show_command
cmd_string = binary_path
pot_file = pot || john_pot_file
if cracker == 'hashcat'
- 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"