Showing 679 of 1,357 total issues
Function size
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.effects.size = function(o) {
return this.queue(function() {
// Create element
Function trigger
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
trigger: function( event, data, elem, onlyHandlers ) {
// Event object or event type
var type = event.type || event,
namespaces = [],
exclusive;
Function animate
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
animate: function( prop, speed, easing, callback ) {
var optall = jQuery.speed(speed, easing, callback);
if ( jQuery.isEmptyObject( prop ) ) {
return this.each( optall.complete, [ false ] );
Function clean
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
clean: function( elems, context, fragment, scripts ) {
var checkScriptType;
context = context || document;
Function finish
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
finish: function() {
if ( this.expected && this.expected != this.assertions.length ) {
QUnit.ok( false, "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" );
}
Method artifact
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
def artifact
render :text => 'Project not specified', :status => 404 and return unless params[:project]
render :text => 'Build not specified', :status => 404 and return unless params[:build]
render :text => 'Path not specified', :status => 404 and return unless params[:path]
- 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 Deferred
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Deferred: function( func ) {
var doneList = jQuery.Callbacks( "once memory" ),
failList = jQuery.Callbacks( "once memory" ),
progressList = jQuery.Callbacks( "memory" ),
state = "pending",
Consider simplifying this complex logical expression. Open
Open
if ( "getBoundingClientRect" in document.documentElement ) {
jQuery.fn.offset = function( options ) {
var elem = this[0], box;
if ( options ) {
Function Datepicker
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Datepicker() {
this.debug = false; // Change this to true to start debugging
this._curInst = null; // The current instance in use
this._keyEvent = false; // If the last event was a key event
this._disabledInputs = []; // List of date picker inputs that have been disabled
Function Datepicker
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Datepicker() {
this.debug = false; // Change this to true to start debugging
this._curInst = null; // The current instance in use
this._keyEvent = false; // If the last event was a key event
this._disabledInputs = []; // List of date picker inputs that have been disabled
Consider simplifying this complex logical expression. Open
Open
if ( "getBoundingClientRect" in document.documentElement ) {
getOffset = function( elem, doc, docElem, box ) {
try {
box = elem.getBoundingClientRect();
} catch(e) {}
Function add
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add: function( elem, types, handler, data ) {
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
Function CSVToTable
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.CSVToTable = function(csvFile, options) {
var defaults = {
tableClass: "CSVTable",
theadClass: "",
thClass: "",
Function add
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add: function( elem, types, handler, data, selector ) {
var elemData, eventHandle, events,
t, tns, type, namespaces, handleObj,
handleObjIn, quick, handlers, special;
Function slide
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
slide: function( options, additions ) {
options = $.extend({
easing: "swing",
duration: 300
}, options, additions );
Function formatDate
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
formatDate: function (format, date, settings) {
if (!date)
return '';
var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
Function slide
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
slide: function( options, additions ) {
options = $.extend({
easing: "swing",
duration: 300
}, options, additions );
Function formatDate
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
formatDate: function (format, date, settings) {
if (!date)
return '';
var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
Function cookie
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
jQuery.cookie = function (key, value, options) {
// key and value given, set cookie...
if (arguments.length > 1 && (value === null || typeof value !== "object")) {
options = jQuery.extend({}, options);
- 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 _showDatepicker
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_showDatepicker: function(input) {
input = input.target || input;
if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
input = $('input', input.parentNode)[0];
if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here