Showing 223 of 433 total issues
File ie-console.js
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Simple Javascript console for IE
*
* Inspired by Firebug for Firefox
*
Function get
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
pos.get = function(o) {
var fixBrowserQuirks = true;
// If a string is passed in instead of an object ref, resolve it
if (typeof(o)=="string") {
o = resolveObject(o);
Class Base
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class ProbeGraph::Base
require 'probe_graph/html'
include ProbeGraph::HTML
attr_reader :benchmarks, :title, :goal
Class Students
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Students < CSVImporter::Base
#13.1196098327637 seconds of overhead for preprocessing the csv and loading into the temporary table (and indexing)
#19.3717708587646,
=begin
def import
Function Sort
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
})();var Sort = (function(){
var sort = {};
sort.AlphaNumeric = function(a,b) {
if (a==b) { return 0; }
if (a<b) { return -1; }
Method links_and_attachments
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def links_and_attachments(obj, tag_type)
return "" unless obj.respond_to? "assets"
obj.assets.inject("") do |str,asset|
str += content_tag(tag_type, link_to_with_icon(asset.name, asset.url)) unless asset.url.blank? or asset.destroyed?
if asset.document?
- 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 process_row
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def process_row line
student= check_student(line[:district_student_id]) or return false
int_def=check_intervention_definition(line[:intervention_definition_id]) or return false
intervention=int_def.interventions.build(:student => student, :user => @user, :start_date => line[:start_date],
- 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 handleRemote
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleRemote: function(element) {
var method, url, data, elCrossDomain, crossDomain, withCredentials, dataType, options;
if (rails.fire(element, 'ajax:before')) {
elCrossDomain = element.data('cross-domain');
File unobtrusive_date_picker.rb
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
module UnobtrusiveDatePicker
DATEPICKER_DEFAULT_NAME_ID_SUFFIXES = { :year => {:id => '', :name => 'year'},
:month => {:id => 'mm', :name => 'month'},
:day => {:id => 'dd', :name => 'day'} }
Function undo
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function undo() {
// skip if this is the first word!
var ti = this.currentTextIndex;
var wi = this.currentWordIndex
Function undo
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function undo() {
// skip if this is the first word!
var ti = this.currentTextIndex;
var wi = this.currentWordIndex
File jquery_ujs.js
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function($, undefined) {
/**
* Unobtrusive scripting adapter for jQuery
* https://github.com/rails/jquery-ujs
IEConsole
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
var IEConsole = {
HEIGHT: 120,
INPUT_HEIGHT: 25,
block: false,
open: false,
Function formatResult
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
formatResult: function(result) {
var type = IEConsole.getType(result);
try {
// DOM Element
if (type == 'DOMElement') {
File district.rb
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
class District < ActiveRecord::Base
# ActiveSupport::Dependencies.load_missing_constant self, :StudentsController
SETTINGS = [:key, :previous_key, :custom_interventions ]
BOOLEAN_SETTINGS = [:restrict_free_lunch, :forgot_password, :lock_tier, :email_on_team_consultation_response, :show_team_consultations_if_pending]
Method ajax_probe_assignment
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def ajax_probe_assignment
@intervention = current_student.interventions.find_by_id(params[:intervention_id]) || Intervention.new
if params[:id] == 'custom'
@intervention_probe_assignment = @intervention.intervention_probe_assignments.build if @intervention
if @intervention_probe_assignment and @intervention_probe_assignment.probe_definition.blank?
- 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 make_date_picker_class_options
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def make_date_picker_class_options(options)
html_classes = []
if options[:highlight_days]
highlight_days = parse_days_of_week(options[:highlight_days])
- 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 dates_of_sims_data
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dates_of_sims_data
referrals= Student.connection.select_all("select distinct s.district_student_id,r.id, r.created_at, (year(r.updated_at + INTERVAL 6 month)) as schoolyear
from students s inner join recommendations r on r.student_id = s.id and r.promoted=true and r.recommendation=5
Function addThNode
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
addThNode: function() {
var dataObj = fdTableSort.tableCache[fdTableSort.tableId];
var pos = fdTableSort.thNode.className.match(/fd-column-([0-9]+)/)[1];
var alt = false;
Function PopupEvent
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
var PopupEvent = (function(){
var ev = {};
// Resolve an event using IE's window.event if necessary
// --------------------------------------------------------------------