gems-uff/sapos

View on GitHub

Showing 281 of 381 total issues

Function Chronoline has a Cognitive Complexity of 244 (exceeds 5 allowed). Consider refactoring.
Open

function Chronoline(domElement, events, options) {
    this.VERSION = "0.1.1";

    var defaults = {
        defaultStartDate: null,  // the date furthest to the left on load. Defaults to today
Severity: Minor
Found in app/assets/javascripts/chronoline/chronoline.js - About 5 days 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 Chronoline has 598 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Chronoline(domElement, events, options) {
    this.VERSION = "0.1.1";

    var defaults = {
        defaultStartDate: null,  // the date furthest to the left on load. Defaults to today
Severity: Major
Found in app/assets/javascripts/chronoline/chronoline.js - About 2 days to fix

    File enrollments_pdf_helper.rb has 934 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module EnrollmentsPdfHelper
      def i18n_eht(key, *args)
        key = "pdf_content.enrollment.header." + key.to_s
        I18n.t(key, *args)
      end
    Severity: Major
    Found in app/helpers/enrollments_pdf_helper.rb - About 2 days to fix

      File chronoline.js has 693 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // chronoline.js v0.1.1
      // by Kevin Leung for Zanbato, https://zanbato.com
      // MIT license at https://github.com/StoicLoofah/chronoline.js/blob/master/LICENSE.md
      
          if (!Date.now) {
      Severity: Major
      Found in app/assets/javascripts/chronoline/chronoline.js - About 1 day to fix

        Method consolidate_phase has a Cognitive Complexity of 48 (exceeds 5 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: Minor
        Found in app/controllers/admissions/admission_processes_controller.rb - About 7 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 prepare_class_schedule_table has a Cognitive Complexity of 41 (exceeds 5 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: Minor
        Found in app/helpers/concerns/class_schedule_helper_concern.rb - About 6 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 grades_report_table has 156 lines of code (exceeds 25 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: Major
        Found in app/helpers/enrollments_pdf_helper.rb - About 6 hrs to fix

          File admission_processes_controller.rb has 419 lines of code (exceeds 250 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 6 hrs to fix

            Method transcript_table has 148 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              Method populate_field has 143 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def populate_field
                  @scope = params[:scope]
                  @parent_record = params[:id].nil? ?
                    new_parent_record : find_if_allowed(params[:id], :update)
              
              
              Severity: Major
              Found in app/controllers/admissions/form_templates_controller.rb - About 5 hrs to fix

                Method thesis_table has 140 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def thesis_table(curr_pdf, options = {})
                    data_table_rows = nil
                    data_table_rows_defense_committee = nil
                
                    curr_pdf.group do |pdf|
                Severity: Major
                Found in app/helpers/enrollments_pdf_helper.rb - About 5 hrs to fix

                  Method create_bigint_migration has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def create_bigint_migration
                      models = {}
                  
                      Dir["app/models/*"].each do |name|
                        model_name = name.match(/app\/models\/(.*?)\.rb/)[1].pluralize
                  Severity: Minor
                  Found in lib/generators/migrate_bigint_generator.rb - About 5 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 thesis_table has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def thesis_table(curr_pdf, options = {})
                      data_table_rows = nil
                      data_table_rows_defense_committee = nil
                  
                      curr_pdf.group do |pdf|
                  Severity: Minor
                  Found in app/helpers/enrollments_pdf_helper.rb - About 4 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 config_form_field_values has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function config_form_field_values(form_field, field, options) {
                    let r = (Math.random() + 1).toString(36).substring(7);
                    let visible = options["visible"] === false ? `style="display:none;"`: "";
                    let main_id = `${form_field.baseid}_${field}_main_id_${r}`
                    let div_id = `${form_field.baseid}_${field}_div_${r}`
                  Severity: Major
                  Found in app/assets/javascripts/form_fields/config_values.js - About 4 hrs to fix

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

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

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

                          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

                          File filled_form_field.rb has 357 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

                            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

                            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