gems-uff/sapos

View on GitHub

Showing 400 of 400 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

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

        File pdf_helper.rb has 456 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require "prawn/measurement_extensions"
         
        module PdfHelper
        include ApplicationHelper
         
         
        Severity: Minor
        Found in app/helpers/pdf_helper.rb - About 6 hrs to fix

          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

          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 thesis_table has 143 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 populate_field has 140 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

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

                    validate: () => {
                    let result = true;
                    if (options["required"] && !form_field.data[field]) {
                    let present_error = form_field.i18n_error(field + "_present_error");
                    $(`#${id}_error`).text(present_error)
                    Severity: Major
                    Found in app/assets/javascripts/form_fields/config_select.js and 1 other location - About 5 hrs to fix
                    app/assets/javascripts/form_fields/config_codemirror.js on lines 41..52

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

                    validate: () => {
                    let result = true;
                    if (options["required"] && !form_field.data[field]) {
                    let present_error = form_field.i18n_error(field + "_present_error");
                    $(`#${id}_error`).text(present_error)
                    Severity: Major
                    Found in app/assets/javascripts/form_fields/config_codemirror.js and 1 other location - About 5 hrs to fix
                    app/assets/javascripts/form_fields/config_select.js on lines 57..68

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

                    if(t.events.length > 0){
                    t.startDate = t.events[0].dates[0];
                    for(var i = 1; i < t.events.length; i++)
                    if(t.events[i].dates[0] < t.startDate)
                    t.startDate = t.events[i].dates[0];
                    Severity: Major
                    Found in app/assets/javascripts/chronoline/chronoline.js and 1 other location - About 5 hrs to fix
                    app/assets/javascripts/chronoline/chronoline.js on lines 284..297

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

                    if(t.events.length > 0){
                    t.endDate = getEndDate(t.events[0].dates);
                    for(var i = 1; i < t.events.length; i++)
                    if(getEndDate(t.events[i].dates) > t.endDate)
                    t.endDate = getEndDate(t.events[i].dates);
                    Severity: Major
                    Found in app/assets/javascripts/chronoline/chronoline.js and 1 other location - About 5 hrs to fix
                    app/assets/javascripts/chronoline/chronoline.js on lines 261..274

                    Method thesis_table has a Cognitive Complexity of 34 (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 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

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