AgileVentures/MetPlus_PETS

View on GitHub

Showing 70 of 122 total issues

Method update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def update
    @agency_person = AgencyPerson.find(params[:id])

    self.action_description = 'edit an agency person'
    authorize @agency_person
Severity: Minor
Found in app/controllers/agency_people_controller.rb - About 35 mins 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

Avoid too many return statements within this method.
Open

    return render json: {:message => 'Task assigned'}
Severity: Major
Found in app/controllers/tasks_controller.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return render json: {:message => e.message}, status: 500
    Severity: Major
    Found in app/controllers/tasks_controller.rb - About 30 mins to fix

      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.
      Severity: Minor
      Found in app/controllers/jobs_controller.rb - About 25 mins 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 list_owners has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def list_owners
          raise 'Unsupported request' if not request.xhr?
          term = params[:q] || {}
          term = term['term'] || ''
          term = term.downcase
      Severity: Minor
      Found in app/controllers/tasks_controller.rb - About 25 mins 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 download_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def self.download_file(file_id)
          # Download the contents of the file which was stored in the Cruncher
          # using the file_id (e.g. resume.id).
          # Save the contents to a Tempfile, and close file.
          # Return the Tempfile instance if successful, nil otherwise.
      Severity: Minor
      Found in app/services/cruncher_service.rb - About 25 mins 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 notify_list_for_js_apply_event has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def self.notify_list_for_js_apply_event(appl)
          # Returns an array containing two arrays.  The first such array contains
          # user ids, and the second email addresses of the people to be notified
          id_list    = []
          email_list = []
      Severity: Minor
      Found in app/models/event.rb - About 25 mins 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 assign has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def assign
          raise 'Unsupported request' if not request.xhr?
          return render( json: {:message => 'Missing assigned target'}, status: 403) if params[:to].nil?
          task = Task.find_by_id params[:id]
          return render json: {:message => 'Cannot find the task!'}, status: 403 if task.nil?
      Severity: Minor
      Found in app/controllers/tasks_controller.rb - About 25 mins 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 match has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        match: function () {
          $('#match_my_resume').on('click', function() {
            var answer = confirm('This will match your résumé against all active jobs ' +
                                 ' and may take a while.     Do you want to proceed?');
            if (answer) {
      Severity: Minor
      Found in app/assets/javascripts/jobs.js - About 25 mins 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 home has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def home
          if request.xhr?
            
            if params[:data_type] == 'skills'
      
      
      Severity: Minor
      Found in app/controllers/company_people_controller.rb - About 25 mins 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

      Severity
      Category
      Status
      Source
      Language