Showing 840 of 1,637 total issues
Function _fnGetObjectDataFn
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnGetObjectDataFn( mSource )
{
if ( mSource === null )
{
/* Give an empty string for rendering / sorting etc */
Function data
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.data = (function() {
var _i, _len, _results;
_results = [];
for (index = _i = 0, _len = data.length; _i < _len; index = ++_i) {
row = data[index];
Function domManip
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
domManip: function( args, callback, allowIntersection ) {
// Flatten any nested arrays
args = core_concat.apply( [], args );
Function ajaxConvert
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ajaxConvert( s, response, jqXHR, isSuccess ) {
var conv2, current, conv, tmp, prev,
converters = {},
// Work with a copy of dataTypes in case we need to modify it for conversion
dataTypes = s.dataTypes.slice();
Function register_observers
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Chosen.prototype.register_observers = function() {
var _this = this;
this.container.bind('mousedown.chosen', function(evt) {
_this.container_mousedown(evt);
Function _fnPageChange
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnPageChange ( oSettings, mAction )
{
var iOldStart = oSettings._iDisplayStart;
if ( typeof mAction === "number" )
Function _mouseStart
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_mouseStart: function(event) {
var that = this,
options = this.options;
this.opos = [event.pageX, event.pageY];
Function winnow_results
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
AbstractChosen.prototype.winnow_results = function() {
var escapedSearchText, option, regex, regexAnchor, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
this.no_results_clear();
results = 0;
Function addGradientFill
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addGradientFill = function (o, gradient, fill) {
o.attrs = o.attrs || {};
var attrs = o.attrs,
pow = Math.pow,
opacity,
Function parseDate
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Morris.parseDate = function(date) {
var isecs, m, msecs, n, o, offsetmins, p, q, r, ret, secs;
if (typeof date === 'number') {
return date;
}
Function stack
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.layout.stack = function() {
var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY;
function stack(data, index) {
var series = data.map(function(d, i) {
return values.call(stack, d, i);
Function parse
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
parse: function( red, green, blue, alpha ) {
if ( red === undefined ) {
this._rgba = [ null, null, null, null ];
return this;
}
Function _fnCreateCookie
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnCreateCookie ( sName, sValue, iSecs, sBaseName, fnCallback )
{
var date = new Date();
date.setTime( date.getTime()+(iSecs*1000) );
Function interHelper
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function interHelper(bez1, bez2, justCount) {
var bbox1 = R.bezierBBox(bez1),
bbox2 = R.bezierBBox(bez2);
if (!R.isBBoxIntersect(bbox1, bbox2)) {
return justCount ? 0 : [];
Function redraw
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Donut.prototype.redraw = function() {
var C, cx, cy, i, idx, last, max_value, min, next, seg, total, value, w, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _results;
this.el.empty();
this.raphael = new Raphael(this.el[0]);
cx = this.el.width() / 2;
Function Local
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
Rickshaw.Fixtures.Time.Local = function() {
var self = this;
this.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
- 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 keydown
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
keydown: function( event ) {
/*jshint maxcomplexity:15*/
if ( this.element.prop( "readOnly" ) ) {
suppressKeyPress = true;
suppressInput = true;
Function keydown
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
keydown: function( event ) {
/*jshint maxcomplexity:15*/
if ( this.element.prop( "readOnly" ) ) {
suppressKeyPress = true;
suppressInput = true;
Function fnUpdate
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.fnUpdate = function( mData, mRow, iColumn, bRedraw, bAction )
{
var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
var i, iLen, sDisplay;
var iRow = (typeof mRow === 'object') ?
Function _refreshValue
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_refreshValue: function() {
var lastValPercent, valPercent, value, valueMin, valueMax,
oRange = this.options.range,
o = this.options,
that = this,