Showing 70 of 122 total issues
File event.rb
has 402 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Event
include ActiveModel::Model
require 'agency_person' # provide visibility to AR model methods
def self.delay_seconds=(delay_seconds)
File jobs_controller.rb
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
class JobsController < ApplicationController
include JobsViewer
include CruncherUtility
include PaginationUtility
Method update
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def update
@jobseeker = JobSeeker.find(params[:id])
authorize @jobseeker
jobseeker_params = handle_user_form_parameters(permitted_attributes(@jobseeker))
dispatch_file = jobseeker_params.delete 'resume'
- 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 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
var PaginationHandler = function (url, viewSelector, successCallback, errorCallback, beforeGetCallback) {
var self = this;
this.spinner = PETS.spinner;
Function TaskManager
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
var TaskManager = function (holder_id, task_type) {
var self = this;
this.load_assign_modal = function (event) {
`` has 26 functions (exceeds 20 allowed). Consider refactoring. Open
var AgencyData = {
add_job_category: function () {
// this function is bound to 'click' event on 'Add Category' button
// in Bootstrap modal: 'agency_admin/_property_modal.html.haml'
AgencyData.add_job_property('job_category', 'job_categories',
File agency_admin.js
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
var AgencyData = {
add_job_category: function () {
// this function is bound to 'click' event on 'Add Category' button
// in Bootstrap modal: 'agency_admin/_property_modal.html.haml'
AgencyData.add_job_property('job_category', 'job_categories',
Function PaginationHandler
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
var PaginationHandler = function (url, viewSelector, successCallback, errorCallback, beforeGetCallback) {
var self = this;
this.spinner = PETS.spinner;
- 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
Class Task
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Task < ActiveRecord::Base
include TaskManager::TaskManager
include TaskManager::BusinessLogic
belongs_to :owner, class_name: 'User', foreign_key: 'owner_user_id'
Class JobsController
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class JobsController < ApplicationController
include JobsViewer
include CruncherUtility
include PaginationUtility
Function delete_job_property
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
delete_job_property: function (job_property, job_prop_plural, delete_url) {
// This functions handles the event created when the
// delete <property> link is clicked on the page.
// The arguments are:
- 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 us_states
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.us_states
[
['Alabama', 'AL'],
['Alaska', 'AK'],
['Arizona', 'AZ'],
Function delete_job_property
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
delete_job_property: function (job_property, job_prop_plural, delete_url) {
// This functions handles the event created when the
// delete <property> link is clicked on the page.
// The arguments are:
Function reject_action
has 42 lines of code (exceeds 25 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();
Method validate_each
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def validate_each(object, attribute, value)
if ENV['MAILGUN_EMAIL_VALIDATION'] == 'yes'
valid_check = EmailValidateService.validate_email(value)
- 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 save_job_to_cruncher
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def save_job_to_cruncher
cruncher_posted = true
unless (changed & %w(title description)).empty?
begin
- 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 process_pagination_params
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def process_pagination_params(entity)
# This method is used in controller actions involved in pagination of
# collection tables (e.g., companies, jobs, etc.).
- 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 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 update
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
@jobseeker = JobSeeker.find(params[:id])
authorize @jobseeker
jobseeker_params = handle_user_form_parameters(permitted_attributes(@jobseeker))
dispatch_file = jobseeker_params.delete 'resume'
Method job_properties
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def job_properties
check_authorization(Agency.this_agency(current_user))
if request.xhr?
case params[:data_type]