AgileVentures/MetPlus_PETS

View on GitHub

Showing 122 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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  $.ajax({type: 'PATCH',
                      url: url,
                      data: {},
                      timeout: 5000,
                      success: function (){
          Severity: Major
          Found in app/assets/javascripts/tasks.js and 1 other location - About 3 hrs to fix
          app/assets/javascripts/tasks.js on lines 55..66

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 96.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  $.ajax({type: 'PATCH',
                      url: url,
                      data: {},
                      timeout: 5000,
                      success: function (){
          Severity: Major
          Found in app/assets/javascripts/tasks.js and 1 other location - About 3 hrs to fix
          app/assets/javascripts/tasks.js on lines 40..51

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 96.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          `` 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

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

              setup_manage_license: function () {
                $('#add_license_button').click(AgencyData.add_license);
                $('#licenses_table').on('click',
                              // bind to 'edit license' anchor element
                              "a[href^='/licenses/'][data-method='edit']",
            Severity: Major
            Found in app/assets/javascripts/agency_admin.js and 2 other locations - About 2 hrs to fix
            app/assets/javascripts/agency_admin.js on lines 387..398
            app/assets/javascripts/agency_admin.js on lines 399..410

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 94.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

              setup_manage_skill: function () {
                $('#add_skill_button').click(AgencyData.add_skill);
                $('#skills_table').on('click',
                              // bind to 'edit skill' anchor element
                              "a[href^='/skills/'][data-method='edit']",
            Severity: Major
            Found in app/assets/javascripts/agency_admin.js and 2 other locations - About 2 hrs to fix
            app/assets/javascripts/agency_admin.js on lines 387..398
            app/assets/javascripts/agency_admin.js on lines 411..422

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 94.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

              setup_manage_job_category: function () {
                $('#add_job_category_button').click(AgencyData.add_job_category);
                $('#job_categories_table').on('click',
                              // bind to 'edit category' anchor element
                              "a[href^='/job_categories/'][data-method='edit']",
            Severity: Major
            Found in app/assets/javascripts/agency_admin.js and 2 other locations - About 2 hrs to fix
            app/assets/javascripts/agency_admin.js on lines 399..410
            app/assets/javascripts/agency_admin.js on lines 411..422

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 94.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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

              Similar blocks of code found in 3 locations. 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)
              Severity: Major
              Found in app/models/event.rb and 2 other locations - About 2 hrs to fix
              app/models/event.rb on lines 253..295
              app/models/event.rb on lines 299..340

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 99.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. 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)
              Severity: Major
              Found in app/models/event.rb and 2 other locations - About 2 hrs to fix
              app/models/event.rb on lines 207..249
              app/models/event.rb on lines 299..340

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 99.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. 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)
              Severity: Major
              Found in app/models/event.rb and 2 other locations - About 2 hrs to fix
              app/models/event.rb on lines 207..249
              app/models/event.rb on lines 253..295

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 99.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              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
                    Severity
                    Category
                    Status
                    Source
                    Language