Showing 223 of 433 total issues
Function writeBody
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function writeBody() {
var d = window.document;
var is_html = false;
d.open();
- 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 group_by_cluster_and_objective
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def self.group_by_cluster_and_objective(params ={})
#This will work better
#refactor this to use recommended monitors?
probes = find(:all, :order =>"active desc, custom, position", :include => [{:intervention_definitions=>{:intervention_cluster=>:objective_definition}},:intervention_probe_assignments, :recommended_monitors])
- 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 writeBody
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function writeBody() {
var d = window.document;
var is_html = false;
d.open();
- 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 setPosition
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Popup.prototype.setPosition = function() {
if (this.position!=null) {
var m = this.position.match(/^(\S+)\s+(\S+)/);
if (m!=null && m.length==3) {
var v = m[1];
- 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 spellChecker.js
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
////////////////////////////////////////////////////
// spellChecker.js
//
// spellChecker object
//
Class User
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :omniauthable, :recoverable#, :registerable
# :recoverable, :rememberable, :trackable, :validatable
Function initSort
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
initSort: function(noCallback, ident) {
var thNode = fdTableSort.thNode;
var tableElem = document.getElementById(fdTableSort.tableId);
if(!(fdTableSort.tableId in fdTableSort.tableCache)) { fdTableSort.prepareTableData(document.getElementById(fdTableSort.tableId)); };
Function DOM
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
var DOM = (function() {
var dom = {};
// Get a parent tag with a given nodename
dom.getParentByTagName = function(o,tagNames) {
Function create
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
var create = function(inp) {
if(!(typeof document.createElement != "undefined" && typeof document.documentElement != "undefined" && typeof document.documentElement.offsetWidth == "number")) return;
var inputs = (inp && inp.tagName) ? [inp] : joinNodeLists(document.getElementsByTagName('input'), document.getElementsByTagName('select'));
var regExp1 = /disable-days-([1-7]){1,6}/g; // the days to disable
Class DistrictExport
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class DistrictExport
attr_reader :dir,:district
TO_EXPORT = [
:answers,
Function onkeydown
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
onkeydown: function (e) {
o.stopTimer();
if(!o.visible) return false;
if(e == null) e = document.parentWindow.event;
Function Screen
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Screen = (function() {
var screen = {};
// Get a reference to the body
// --------------------------------------------------------------------
Function PopupEvent
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
var PopupEvent = (function(){
var ev = {};
// Resolve an event using IE's window.event if necessary
// --------------------------------------------------------------------
- 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
Class Checklist
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class Checklist < ActiveRecord::Base
DISTRICT_PARENT = :checklist_definition
has_many :answers, :dependent => :destroy
belongs_to :checklist_definition, :include => {:question_definitions => {:element_definitions => :answer_definitions}}
belongs_to :student
Function terminateSpell
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function terminateSpell() {
// called when we have reached the end of the spell checking.
var msg = "Spell check complete:\n\n";
var numrepl = this._getTotalReplaced();
if( numrepl == 0 ) {
- 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 terminateSpell
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function terminateSpell() {
// called when we have reached the end of the spell checking.
var msg = "Spell check complete:\n\n";
var numrepl = this._getTotalReplaced();
if( numrepl == 0 ) {
- 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 prepareTableData
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
prepareTableData: function(table) {
var data = [];
var start = table.getElementsByTagName('tbody');
start = start.length ? start[0] : table;
Class Intervention
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Intervention < ActiveRecord::Base
DISTRICT_PARENT = :intervention_definition
include LinkAndAttachmentAssets
include ActionView::Helpers::TextHelper
include Stats::Intervention
Class GroupedProgressEntry
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class GroupedProgressEntry
# include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
attr_accessor :global_date, :intervention, :probe_definition
Class ApplicationController
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
helper_method :multiple_selected_students?, :selected_student_ids,
:current_student_id, :current_student, :current_district, :current_school, :current_user,
:index_url_with_page, :readonly?