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
- Read upRead up
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
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
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) {
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
- Read upRead up
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 ||= []
- Read upRead up
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]
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
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]
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)
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|
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
- Read upRead up
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|
- Read upRead up
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}`
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 = []
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
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
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
- Read upRead up
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
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?
- Read upRead up
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"