Showing 371 of 658 total issues
Function ajaxConvert
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ajaxConvert( s, response ) {
var conv, conv2, current, tmp,
converters = {},
i = 0,
Function internalData
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function internalData( elem, name, data, pvt /* Internal Use Only */ ){
if ( !jQuery.acceptData( elem ) ) {
return;
}
Function formatTime
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.datepicker.formatTime = function(format, time, options) {
options = options || {};
options = $.extend({}, $.timepicker._defaults, options);
time = $.extend({
hour: 0,
Consider simplifying this complex logical expression. Open
Open
if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor !== Array) {
c = $(o.containment);
ce = c[0];
if(!ce) {
Function animateClass
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.effects.animateClass = function( value, duration, easing, callback ) {
var o = $.speed( duration, easing, callback );
return this.queue( function() {
var animated = $( this ),
Consider simplifying this complex logical expression. Open
Open
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
handlers.splice( j, 1 );
Function remove
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
remove: function( elem, types, handler, selector, mappedTypes ) {
var j, origCount, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
Function blind
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.effects.effect.blind = function( o, done ) {
// Create element
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
mode = $.effects.setMode( el, o.mode || "hide" ),
Function _setOption
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_setOption: function( key, value ) {
/*jshint maxcomplexity:15*/
var isDraggable, isResizable,
uiDialog = this.uiDialog;
Function _animate
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_animate: function( toShow, toHide, data ) {
var total, easing, duration,
that = this,
adjust = 0,
down = toShow.length &&
Function _mouseCapture
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_mouseCapture: function( event ) {
var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
that = this,
o = this.options;
Function _determineDate
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_determineDate: function(inst, date, defaultDate) {
var offsetNumeric = function(offset) {
var date = new Date();
date.setDate(date.getDate() + offset);
return date;
Function _toggle
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_toggle: function( event, eventData ) {
var that = this,
toShow = eventData.newPanel,
toHide = eventData.oldPanel;
Function internalRemoveData
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function internalRemoveData( elem, name, pvt /* For internal use only */ ){
if ( !jQuery.acceptData( elem ) ) {
return;
}
Method to_hash
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
def to_hash(response_set)
# all responses to associated question
responses = question.blank? ? [] : response_set.responses.where("responses.answer_id in (?)", question.answer_ids)
if self.operator.match /^count(>|>=|<|<=|==|!=)\d+$/
op, i = self.operator.scan(/^count(>|>=|<|<=|==|!=)(\d+)$/).flatten
- 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 build_and_set
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
def build_and_set(context, r)
case r[:field_type]
when "text"
self.attributes = {
:response_class => "string",
- 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 scale
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.effects.effect.scale = function( o, done ) {
// Create element
var el = $( this ),
options = $.extend( true, {}, o ),
Function resize
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
resize: function() {
var that = $(this).data("ui-resizable"),
o = that.options,
cs = that.size,
os = that.originalSize,
Function fold
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.effects.effect.fold = function( o, done ) {
// Create element
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
Function _generatePosition
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_generatePosition: function(event) {
var top, left,
o = this.options,
pageX = event.pageX,