Showing 371 of 658 total issues
Function _newInst
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_newInst: function($input, o) {
var tp_inst = new Timepicker(),
inlineSettings = {},
fns = {},
overrides, i;
Function _limitMinMaxDateTime
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_limitMinMaxDateTime: function(dp_inst, adjustSliders) {
var o = this._defaults,
dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
if (!this._defaults.showTimepicker) {
Function _create
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_create: function() {
var n, i, handle, axis, hname,
that = this,
o = this.options;
File parser.rb
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
%w(survey survey_translation survey_section question_group question dependency dependency_condition answer validation validation_condition).each {|model| require model }
require 'yaml'
module Surveyor
Consider simplifying this complex logical expression. Open
Open
if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
if(inst.snapElements[i].snapping) {
(inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
}
inst.snapElements[i].snapping = false;
Function defaultPrefilter
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function defaultPrefilter( elem, props, opts ) {
/*jshint validthis:true */
var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire,
anim = this,
style = elem.style,
Function send
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
send: function( headers, complete ) {
// Get a new xhr
var handle, i,
xhr = s.xhr();
Function _refresh
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_refresh: function() {
var maxHeight,
options = this.options,
heightStyle = options.heightStyle,
parent = this.element.parent(),
Function trigger
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
trigger: function( event, data, elem, onlyHandlers ) {
var i, cur, tmp, bubbleType, ontype, handle, special,
eventPath = [ elem || document ],
type = event.type || event,
Function _doKeyDown
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_doKeyDown: function(event) {
var onSelect, dateStr, sel,
inst = $.datepicker._getInst(event.target),
handled = true,
isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
Function Animation
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Animation( elem, properties, options ) {
var result,
stopped,
index = 0,
length = animationPrefilters.length,
Function _keydown
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_keydown: function( event ) {
/*jshint maxcomplexity:20*/
var match, prev, character, skip, regex,
preventDefault = true;
Function formatDate
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
formatDate: function (format, date, settings) {
if (!date) {
return "";
}
Method unparse
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
def unparse(dsl)
with_defaults = Answer.new(:text => text)
attrs = self.attributes.delete_if{|k,v| with_defaults[k] == v or %w(created_at updated_at reference_identifier response_class id question_id api_id).include? k}.symbolize_keys!
attrs.delete(:is_exclusive) if text == "Omit" && is_exclusive == true
attrs.merge!({:is_exclusive => false}) if text == "Omit" && is_exclusive == false
- 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 Sizzle
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Sizzle( selector, context, results, seed ) {
var match, elem, m, nodeType,
// QSA vars
i, groups, old, nid, newContext, newSelector;
Function _clear
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_clear: function(event, noPropagation) {
this.reverting = false;
// We delay all events that have to be triggered to after the point where the placeholder has been removed and
// everything else normalized again
Function _onTimeChange
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_onTimeChange: function() {
var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,
second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false,
millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false,
Function _mouseStart
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_mouseStart: function(event, overrideHandle, noActivation) {
var i,
o = this.options;
Function _mouseDrag
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_mouseDrag: function(event) {
var i, item, itemElement, intersection,
o = this.options,
scrolled = false;
Function _optionDatepicker
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.datepicker._optionDatepicker = function(target, name, value) {
var inst = this._getInst(target),
name_clone;
if (!inst) {
return null;