File jobs_controller.rb
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
class JobsController < ApplicationController
include JobsViewer
include CruncherUtility
include PaginationUtility
Class JobsController
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class JobsController < ApplicationController
include JobsViewer
include CruncherUtility
include PaginationUtility
Method index
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
# Store, or recover, search and items-per-page criteria
search_params, @items_count, items_per_page =
process_pagination_params('searched_jobs')
Method index
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def index
# Store, or recover, search and items-per-page criteria
search_params, @items_count, items_per_page =
process_pagination_params('searched_jobs')
- 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
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"
Further reading
Method create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create
save_params = job_params
# if new_address_params is not nil then user wants to create a new
# job location (company address) and associate that with this job.
- 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"