Showing 70 of 122 total issues
Method my_js_as_jd
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def my_js_as_jd
raise 'Unsupported request' if not request.xhr?
term = params[:q] || {}
term = term[:term] || ''
term = term.downcase
- 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 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
Function load_div_from_url
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.load_div_from_url = function(target_idx, url) {
if(typeof self.successCallback == 'undefined')
self.successCallback = PaginationFunctions.getSuccessFunction(self.name);
if(typeof self.errorCallback == 'undefined')
Method evt_jd_apply
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.evt_jd_apply(evt_obj) # evt_obj = job_app
# Job is applied by job developer for his job seeker
# Business rules:
# Notify job seeker
# Notify company contact associated with the job
Method home
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def home
if request.xhr?
if params[:data_type] == 'skills'
Method assign_job_seeker
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def assign_job_seeker
# Assign agency person, in specified role, to the job seeker
@agency_person = AgencyPerson.find(params[:id])
self.action_description = 'assign a job seeker'
Method update
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
@agency_person = AgencyPerson.find(params[:id])
self.action_description = 'edit an agency person'
authorize @agency_person
Method create
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.create(evt_type, evt_obj)
case evt_type
when :JS_REGISTER
evt_js_register(evt_obj)
when :COMP_REGISTER
Method evt_app_rejected
has 34 lines of code (exceeds 25 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)
Function add_job_property
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
add_job_property: function (job_property, job_prop_plural, attr1, attr2) {
// This functions handles the event created when the
// "Add <property>" button is clicked on the bootstrap modal.
// The arguments are:
Function success
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
success: function (data, status, xhrObject) {
var company_id = null;
if ($('#company_id') != null) {
company_id = $('#company_id').val();
Method evt_app_accepted
has 34 lines of code (exceeds 25 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)
Method evt_app_processing
has 34 lines of code (exceeds 25 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)
Function spinner
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
spinner: function(target){
var self = this;
this.spinnerOpts = {
lines: 13 // The number of lines to draw
, length: 28 // The length of each line
Method invite_resource
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def invite_resource(&block)
user = resource_class.invite!(invite_params, current_inviter, &block)
if user.errors.empty?
if (person = user.actable)
# If a person is already associated with this user, this means that
- 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 update_job_property
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
update_job_property: function (job_property, job_prop_plural, attr1, attr2) {
// This functions handles the event created when the
// "Update <property>" button is clicked on the bootstrap modal.
// The arguments are:
Function setup
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup: function() {
$('#assignTaskModal').on('shown.bs.modal', function (e) {
$('#assignTaskModal_button').off('click').click( function() {
if ($("#task_assign_select").val() === null) {
return;
Method evt_job_revoked
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.evt_job_revoked(evt_obj)
# evt_obj = struct(:job, :agency)
# Notify all job developers in agency (email and popup)
job_developers = Agency.job_developers(evt_obj.agency)
Method invite_resource
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def invite_resource(&block)
user = resource_class.invite!(invite_params, current_inviter, &block)
if user.errors.empty?
if (person = user.actable)
# If a person is already associated with this user, this means that
Function reject_action
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
reject_action: function (e) {
var link_url = $(this).attr('href');
if(!RejectAppln.check_for_reason()) {
// Prevent closing the modal
e.preventDefault();
- 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"