AgileVentures/MetPlus_PETS

View on GitHub

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)
Severity: Minor
Found in app/models/event.rb - About 5 hrs to fix

    File jobs_controller.rb has 324 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class JobsController < ApplicationController
      include JobsViewer
      include CruncherUtility
      include PaginationUtility
    
    
    Severity: Minor
    Found in app/controllers/jobs_controller.rb - About 3 hrs to fix

      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'
      Severity: Minor
      Found in app/controllers/job_seekers_controller.rb - About 3 hrs to fix

      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;
      Severity: Major
      Found in app/assets/javascripts/pagination.js - About 3 hrs to fix

        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) {
        Severity: Major
        Found in app/assets/javascripts/tasks.js - About 3 hrs to fix

          `` 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',
          Severity: Minor
          Found in app/assets/javascripts/agency_admin.js - About 3 hrs to fix

            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',
            Severity: Minor
            Found in app/assets/javascripts/agency_admin.js - About 2 hrs to fix

              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;
              Severity: Minor
              Found in app/assets/javascripts/pagination.js - About 2 hrs to fix

              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'
              Severity: Minor
              Found in app/models/task.rb - About 2 hrs to fix

                Class JobsController has 24 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class JobsController < ApplicationController
                  include JobsViewer
                  include CruncherUtility
                  include PaginationUtility
                
                
                Severity: Minor
                Found in app/controllers/jobs_controller.rb - About 2 hrs to fix

                  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:
                  Severity: Minor
                  Found in app/assets/javascripts/agency_admin.js - About 2 hrs to fix

                  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'],
                  Severity: Major
                  Found in app/models/address.rb - About 2 hrs to fix

                    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:
                    Severity: Minor
                    Found in app/assets/javascripts/agency_admin.js - About 1 hr to fix

                      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();
                      Severity: Minor
                      Found in app/assets/javascripts/job_applications.js - About 1 hr to fix

                        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)
                        Severity: Minor
                        Found in app/validators/email_validator.rb - About 1 hr to fix

                        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
                        Severity: Minor
                        Found in app/models/job.rb - About 1 hr to fix

                        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.).
                        
                        
                        Severity: Minor
                        Found in app/controllers/concerns/pagination_utility.rb - About 1 hr to fix

                        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')
                        
                        
                        Severity: Minor
                        Found in app/controllers/jobs_controller.rb - About 1 hr to fix

                          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'
                          Severity: Minor
                          Found in app/controllers/job_seekers_controller.rb - About 1 hr to fix

                            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]
                            Severity: Minor
                            Found in app/controllers/agency_admin_controller.rb - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language