gems-uff/sapos

View on GitHub

Showing 400 of 400 total issues

Method consolidate_phase has 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def consolidate_phase
i18n_prefix = "active_scaffold.admissions/admission_process.consolidate_phase"
@admission_process = Admissions::AdmissionProcess.find(params[:id])
@show_page = params[:show_summary]
phase_id = params[:consolidate_phase_id].to_i
Severity: Major
Found in app/controllers/admissions/admission_processes_controller.rb - About 4 hrs to fix

    File filled_form_field.rb has 361 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class Admissions::FilledFormField < ActiveRecord::Base
    has_paper_trail
     
    serialize :list
     
     
    Severity: Minor
    Found in app/models/admissions/filled_form_field.rb - About 4 hrs to fix

      File class_enrollment_requests_controller.rb has 358 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      class ClassEnrollmentRequestsController < ApplicationController
      include EnrollmentSearchConcern
      include EnrollmentRequestSearchConcern
      authorize_resource
       
       
      Severity: Minor
      Found in app/controllers/class_enrollment_requests_controller.rb - About 4 hrs to fix

        Method enrollment_scholarships_table has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        def enrollment_scholarships_table(curr_pdf, options = {})
        curr_pdf.group do |pdf|
        enrollment ||= options[:enrollment]
        scholarship_durations = enrollment.scholarship_durations
         
         
        Severity: Minor
        Found in app/helpers/enrollments_pdf_helper.rb - About 4 hrs to fix

        Method signature_footer has 114 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def signature_footer(pdf, options = {})
        x = 5
         
        diff_width = options[:diff_width]
        diff_width ||= 0
        Severity: Major
        Found in app/helpers/pdf_helper.rb - About 4 hrs to fix

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

          t.leftControl.onmousedown = function(e){
          t.toScrollDiscrete = true;
          t.scrollPaperStart = getLeft(t.paperElem);
          t.scrollTimeoutId = setTimeout(function(){
          t.toScrollDiscrete = false; // switched is flipped
          Severity: Major
          Found in app/assets/javascripts/chronoline/chronoline.js and 1 other location - About 4 hrs to fix
          app/assets/javascripts/chronoline/chronoline.js on lines 830..839

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

          t.rightControl.onmousedown = function(e){
          t.toScrollDiscrete = true;
          t.scrollPaperStart = getLeft(t.paperElem);
          t.scrollTimeoutId = setTimeout(function(){
          t.toScrollDiscrete = false; // switched is flipped
          Severity: Major
          Found in app/assets/javascripts/chronoline/chronoline.js and 1 other location - About 4 hrs to fix
          app/assets/javascripts/chronoline/chronoline.js on lines 797..806

          Method to_text has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

          def to_text(blank: "-", field_type: nil, custom: {})
          return blank if self.form_field.blank?
          form_field = self.form_field
          field_type ||= form_field.field_type
          if custom[field_type].present?
          Severity: Minor
          Found in app/models/admissions/filled_form_field.rb - About 4 hrs to fix

          Method search_table has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

          def search_table(pdf, options = {})
          search ||= options[:search]
           
          return if search.blank?
          values = []
          Severity: Minor
          Found in app/helpers/enrollments_pdf_helper.rb - About 4 hrs to fix

          Function carrierwave_webcam has 99 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function carrierwave_webcam(div) {
          let id = $(div).data("id");
          let url = $(div).data("url");
          let basename = $(div).data("basename");
          let column = $(div).data("column");
          Severity: Major
          Found in app/assets/javascripts/form_widgets/carrierwave_webcam_widget.js - About 3 hrs to fix

            Method grade_for_situation has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            def grade_for_situation
            if course_has_grade
            unless self.grade.blank?
            self.errors.add(:grade, :grade_gt_100) if self.grade > 100
            self.errors.add(:grade, :grade_lt_0) if self.grade < 0
            Severity: Minor
            Found in app/models/class_enrollment.rb - About 3 hrs to fix

            Class AdmissionProcessesController has 30 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class Admissions::AdmissionProcessesController < ApplicationController
            authorize_resource
            include ApplicationHelper
            include PdfHelper
             
             
            Severity: Minor
            Found in app/controllers/admissions/admission_processes_controller.rb - About 3 hrs to fix

              Method prepare_class_schedule_table has 90 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              def prepare_class_schedule_table(
              course_classes, on_demand, advisement_authorizations = nil,
              keep_on_demand = false, used_to_render_a_pdf_report: false
              )
              advisement_authorizations ||= []
              Severity: Major
              Found in app/helpers/concerns/class_schedule_helper_concern.rb - About 3 hrs to fix

                Method grades_report_table has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                Open

                def grades_report_table(pdf, options = {})
                enrollment ||= options[:enrollment]
                total_class_enrollments ||= options[:class_enrollments]
                 
                table_width = [66, 215, 57, 57, 50, 50, 65]
                Severity: Minor
                Found in app/helpers/enrollments_pdf_helper.rb - About 3 hrs to fix

                Method transcript_table has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                Open

                def transcript_table(pdf, options = {})
                class_enrollments ||= options[:class_enrollments]
                 
                table_width = [66, 280, 57, 57, 50, 50]
                 
                 
                Severity: Minor
                Found in app/helpers/enrollments_pdf_helper.rb - About 3 hrs to fix

                Method assign_multiparameter_attributes has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                Open

                def assign_multiparameter_attributes(pairs)
                self.class.defined_month_years.each do |attribute|
                found_day = nil
                found_month = nil
                found_year = nil
                Severity: Minor
                Found in app/models/concerns/month_year_concern.rb - About 3 hrs to fix

                File enrollments_controller.rb has 309 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                class EnrollmentsController < ApplicationController
                include EnrollmentSearchConcern
                include SharedPdfConcern
                 
                authorize_resource
                Severity: Minor
                Found in app/controllers/enrollments_controller.rb - About 3 hrs to fix

                  Method new_document has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  def new_document(name, title, options = {}, &block)
                  type = options[:pdf_type] || :report
                  pdf_config = setup_pdf_config(type, options)
                   
                  document = prawn_document({
                  Severity: Major
                  Found in app/helpers/pdf_helper.rb - About 3 hrs to fix

                    File enrollments_helper.rb has 307 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    module EnrollmentsHelper
                    include PdfHelper
                    include EnrollmentsPdfHelper
                     
                    include EnrollmentHelperConcern
                    Severity: Minor
                    Found in app/helpers/enrollments_helper.rb - About 3 hrs to fix

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

                      $(`#${form_field.baseid}_${field}_${r} a`).on('click', function() {
                      $(this).closest('tbody').remove();
                      form_field.data[field] = $(`#${div_id} table input`).map((i, el) => $(el).val()).toArray();
                      form_field.save_config();
                      return false;
                      Severity: Major
                      Found in app/assets/javascripts/form_fields/config_values.js and 1 other location - About 3 hrs to fix
                      app/assets/javascripts/form_fields/config_values.js on lines 56..61
                      Severity
                      Category
                      Status
                      Source
                      Language