Showing 70 of 122 total issues
Method create_task
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create_task(audience, task_type, *args)
person = nil
job_application = nil
company = nil
job = nil
- 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 apply
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def apply
@job = Job.find_by(id: params[:job_id])
unless @job
flash[:alert] = 'Unable to find the job the user is trying to apply to.'
redirect_to(jobs_url) && return
Function match
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
match: function () {
$('#match_my_resume').on('click', function() {
var answer = confirm('This will match your résumé against all active jobs ' +
' and may take a while. Do you want to proceed?');
if (answer) {
Method perform
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform(email_addresses, evt_type, *evt_obj)
case evt_type
when Event::EVT_TYPE[:JS_REGISTER]
AgencyMailer.job_seeker_registered(email_addresses, evt_obj[0]).deliver_later
Method home
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def home
if Agency.this_agency(current_user).nil?
flash[:notice] = 'Current agency cannot be determined'
redirect_to(root_path) && return
end
Method process_match_results
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def process_match_results(results, key_id)
match_set = {}
return match_set if results.nil?
# First level of results is a hash of specific matcher results ....
- 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 create
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def create
jobseeker_params = form_params
dispatch_file = jobseeker_params.delete 'resume'
@jobseeker = JobSeeker.new(jobseeker_params)
- 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 new_task
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
task_type,
owner,
target_person = nil,
target_job_application = nil,
target_company = nil,
Method target
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def target
return person unless person.nil?
return company unless company.nil?
return job_application unless job_application.nil?
return job unless job.nil?
- 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 update_profile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update_profile
@company_addresses = Company.find(@company_person.company_id).addresses
person_params = handle_user_form_parameters company_person_params
if @company_person.update_attributes(person_params)
- 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
Function PaginationHandler
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var PaginationHandler = function (url, viewSelector, successCallback, errorCallback, beforeGetCallback) {
Function change_job_property_success
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
change_job_property_success: function (modal_id, model_errors_id,
job_prop_plural, company_id,
user_type) {
Method validate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate(task)
if task.try(:owner).nil? and task.try(:owner_company).nil? and task.try(:owner_agency).nil?
task.errors[:task_owner] << "need to be set"
elsif not task.owner_company.nil? and task.try(:owner_company_role).nil?
task.errors[:task_owner] << "no company role set"
- 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 evt_app_rejected
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.evt_app_rejected(evt_obj)
# evt_obj = job application
# Business rules:
# Notify job seeker's job developer (email and popup)
# Notify job seeker's case manager (email and popup)
- 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 upload_file
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.upload_file(file, file_name, file_id)
mime_type = MIME::Types.type_for(URI.escape(file_name))
raise "Invalid MIME type for file: #{file_name}" if mime_type.empty?
raise "Unsupported file type for: #{file_name}" unless
- 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 evt_app_processing
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.evt_app_processing(evt_obj)
# evt_obj = job application
# Business rules:
# Notify job seeker's job developer (email and popup)
# Notify job seeker's case manager (email and popup)
- 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 evt_app_accepted
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.evt_app_accepted(evt_obj)
# evt_obj = job application
# Business rules:
# Notify job seeker's job developer (email and popup)
# Notify job seeker's case manager (email and popup)
- 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 max_salary_consistent_with_min_salary
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def max_salary_consistent_with_min_salary
if max_salary.present?
if min_salary.present?
errors.add(:max_salary, 'cannot be less than minimum salary') if
- 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 apply
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def apply
@job = Job.find_by(id: params[:job_id])
unless @job
flash[:alert] = 'Unable to find the job the user is trying to apply to.'
redirect_to(jobs_url) && return
- 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 match_job_seekers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def match_job_seekers
authorize @job
Pusher.trigger('pusher_control',
'spinner_start',
user_id: pets_user.user.id,
- 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"