Showing 840 of 1,637 total issues
Function d3_scale_log
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function d3_scale_log(linear, base, positive, domain) {
function log(x) {
return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base);
}
function pow(x) {
Function CHILD
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
"CHILD": function( type, what, argument, first, last ) {
var simple = type.slice( 0, 3 ) !== "nth",
forward = type.slice( -4 ) !== "last",
ofType = what === "of-type";
Function update
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.update = function() {
Rickshaw.keys(self.data).forEach( function(time) {
var annotation = self.data[time];
Function Class
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Class = (function() {
// Some versions of JScript fail to enumerate over properties, names of which
// correspond to non-enumerable properties in the prototype chain
var IS_DONTENUM_BUGGY = (function(){
Consider simplifying this complex logical expression. Open
Open
if ( forward && useCache ) {
// Seek `elem` from a previously-cached index
outerCache = parent[ expando ] || (parent[ expando ] = {});
cache = outerCache[ type ] || [];
nodeIndex = cache[0] === dirruns && cache[1];
Function _generatePosition
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_generatePosition: function(event) {
var containment, co, top, left,
o = this.options,
scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent,
Function attr
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
elproto.attr = function (name, value) {
if (this.removed) {
return this;
}
if (name == null) {
Function eve
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
eve = function (name, scope) {
var e = events,
oldstop = stop,
args = Array.prototype.slice.call(arguments, 2),
listeners = eve.listeners(name),
Function hierarchy
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.layout.hierarchy = function() {
var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue;
function recurse(node, depth, nodes) {
var childs = children.call(hierarchy, node, depth);
node.depth = depth;
Function tick
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
force.tick = function() {
if ((alpha *= .99) < .005) {
event.end({
type: "end",
alpha: alpha = 0
Function init
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function( selector, context, rootjQuery ) {
var match, elem;
// HANDLE: $(""), $(null), $(undefined), $(false)
if ( !selector ) {
Function keydown
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
keydown: function( event ) {
/*jshint maxcomplexity:25*/
var allowed, curVal, newVal, step,
index = $( event.target ).data( "ui-slider-handle-index" );
Function d3_geo_clipPolygon
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) {
var subject = [], clip = [];
segments.forEach(function(segment) {
if ((n = segment.length - 1) <= 0) return;
var n, p0 = segment[0], p1 = segment[n];
File 0010_plugin_data_migration.py
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
Function fnUpdate
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
"fnUpdate": function ( oSettings, fnDraw ) {
var iListLength = 5;
var oPaging = oSettings.oInstance.fnPagingInfo();
var an = oSettings.aanFeatures.p;
var i, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);
- 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 createWrapper
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createWrapper: function( element ) {
// if the element is already wrapped, return it
if ( element.parent().is( ".ui-effects-wrapper" )) {
return element.parent();
Function renderRegion
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderRegion: function (valuenum, highlight) {
var vals = this.values[valuenum],
options = this.options,
xaxisOffset = this.xaxisOffset,
result = [],
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 _fnColumnOptions
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnColumnOptions( oSettings, iCol, oOptions )
{
var oCol = oSettings.aoColumns[ iCol ];
/* User specified column options */
Function fnFilter
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.fnFilter = function( sInput, iColumn, bRegex, bSmart, bShowGlobal, bCaseInsensitive )
{
var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
if ( !oSettings.oFeatures.bFilter )