Showing 34 of 475 total issues
Method hashcat_parameters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def hashcat_parameters
parameters = []
parameters << attack_mode_param
parameters << markov_threshold_param if classic_markov
parameters << "-O" if optimized
- 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 update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update
if hash_list_params[:file].present?
@hash_list.processed = false
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
Avoid too many return
statements within this method. Open
return nil if patch_match.empty?
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return tasks.create(attack: attack, start_date: Time.zone.now) if meets_performance_threshold?(attack.hash_mode)
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return nil if latest.nil?
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return pending_task if pending_task
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return head :gone if @task.paused?
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return unless task.completed?
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return patch_match.first if patch_match.first.patch_version > sem_version.patch
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return head :no_content
- Create a ticketCreate a ticket
Method sidebar_link
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sidebar_link(name, path, icon)
class_name = current_page?(path) ? "active" : ""
content_tag :li, class: "nav-item" do
link_to path, class: "nav-link #{class_name}" do
if icon.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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(builder, attribute_name, column, input_type, options = {}) # rubocop:disable Metrics/ParameterLists
raise ArgumentError, "EnumInput requires an enum column." unless column.is_a? ActiveRecord::Enum::EnumType
# Enum's are only required if we do not allow nil values
inclusion_validator = builder.object.class.validators_on(attribute_name).find { |v| v.kind == :inclusion }
- 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 update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update
respond_to do |format|
if @attack.update(attack_params)
@attack.abandon! if @attack.can_abandon?
format.html { redirect_to campaigns_path(@attack.campaign), notice: "Attack was successfully updated." }
- 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"