Showing 34 of 475 total issues
Class Attack
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class Attack < ApplicationRecord
acts_as_paranoid # Soft deletes the attack
##
# Associations
- Create a ticketCreate a ticket
Method perform
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Confirmed
def perform(id)
list = HashList.find(id)
return if list.processed?
HashList.transaction do
- Read upRead up
- Create a ticketCreate a ticket
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 attack.rb
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Attack < ApplicationRecord
acts_as_paranoid # Soft deletes the attack
##
# Associations
- Create a ticketCreate a ticket
Method submit_status
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def submit_status
@task = @agent.tasks.find(params[:id])
@task.update(activity_timestamp: Time.zone.now)
status = @task.hashcat_statuses.build({
original_line: params[:original_line],
- Create a ticketCreate a ticket
Method new_task
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def new_task
# Immediately return the first incomplete task if there's no fatal errors for it.
incomplete_task = tasks.incomplete.find do |task|
!agent_errors.exists?(severity: :fatal, task_id: task.id) && task.uncracked_remaining
end
- Read upRead up
- Create a ticketCreate a ticket
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 submit_error
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def submit_error
if @agent.blank?
render json: { error: "Agent not found" }, status: :not_found
return
end
- Read upRead up
- Create a ticketCreate a ticket
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 check_for_cracker_update
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_for_cracker_update
current_version = params[:version]
operating_system = params[:operating_system]
if current_version.blank? || current_version.nil?
- Create a ticketCreate a ticket
Method calculate_mask_candidates
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.calculate_mask_candidates(mask_line)
require "bigdecimal"
charset_counts = {
"?a" => 95, # All printable ASCII characters
- Create a ticketCreate a ticket
Method calculate_mask_candidates
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.calculate_mask_candidates(mask_line)
require "bigdecimal"
charset_counts = {
"?a" => 95, # All printable ASCII characters
- Read upRead up
- Create a ticketCreate a ticket
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 submit_status
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def submit_status
@task = @agent.tasks.find(params[:id])
@task.update(activity_timestamp: Time.zone.now)
status = @task.hashcat_statuses.build({
original_line: params[:original_line],
- Read upRead up
- Create a ticketCreate a ticket
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 submit_error
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def submit_error
if @agent.blank?
render json: { error: "Agent not found" }, status: :not_found
return
end
- Create a ticketCreate a ticket
Method new_task
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def new_task
# Immediately return the first incomplete task if there's no fatal errors for it.
incomplete_task = tasks.incomplete.find do |task|
!agent_errors.exists?(severity: :fatal, task_id: task.id) && task.uncracked_remaining
end
- Create a ticketCreate a ticket
Method submit_crack
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def submit_crack
timestamp = params[:timestamp]
hash = params[:hash]
plain_text = params[:plain_text]
- Create a ticketCreate a ticket
Method submit_benchmark
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def submit_benchmark
# There's a weird bug where the JSON is sometimes in the body and as a param.
if params[:hashcat_benchmarks].nil?
render json: { error: "No benchmarks submitted" }, status: :bad_request
return
- Create a ticketCreate a ticket
Method check_for_cracker_update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def check_for_cracker_update
current_version = params[:version]
operating_system = params[:operating_system]
if current_version.blank? || current_version.nil?
- Read upRead up
- Create a ticketCreate a ticket
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 perform
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def perform(mask_list_id)
mask_list = MaskList.find(mask_list_id)
return if mask_list.nil? || mask_list.file.nil? || mask_list.complexity_value != 0
total_combinations = 0
- Read upRead up
- Create a ticketCreate a ticket
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 check_for_newer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def check_for_newer(operating_system_name, version_string)
# Convert the version string to a semantic version.
sem_version = CrackerBinary.to_semantic_version(version_string)
# Return nil if the version string is invalid.
- Read upRead up
- Create a ticketCreate a ticket
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 submit_crack
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def submit_crack
timestamp = params[:timestamp]
hash = params[:hash]
plain_text = params[:plain_text]
- Read upRead up
- Create a ticketCreate a ticket
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 submit_benchmark
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def submit_benchmark
# There's a weird bug where the JSON is sometimes in the body and as a param.
if params[:hashcat_benchmarks].nil?
render json: { error: "No benchmarks submitted" }, status: :bad_request
return
- Read upRead up
- Create a ticketCreate a ticket
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 initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(builder, attribute_name, column, input_type, options = {}) # rubocop:disable Metrics/ParameterLists
- Create a ticketCreate a ticket