Showing 840 of 1,637 total issues
Function animation
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
animation = function () {
var Now = +new Date,
l = 0;
for (; l < animationElements.length; l++) {
var e = animationElements[l];
Function support
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.support = (function( support ) {
var all, a, input, select, fragment, opt, eventName, isSupported, i,
div = document.createElement("div");
Function ClassList
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Rickshaw.Compat.ClassList = function() {
/* adapted from http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
if (typeof document !== "undefined" && !("classList" in document.createElement("a"))) {
Function _fnFeatureHtmlTable
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnFeatureHtmlTable ( oSettings )
{
/* Check if scrolling is enabled or not - if not then leave the DOM unaltered */
if ( oSettings.oScroll.sX === "" && oSettings.oScroll.sY === "" )
{
Function _fnAddOptionsHtml
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnAddOptionsHtml ( oSettings )
{
/*
* Create a temporary, empty, div which we can later on replace with what we have generated
* we do it this way to rendering the 'options' html offline - speed :-)
Function chord
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.layout.chord = function() {
var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords;
function relayout() {
var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j;
chords = [];
Function tree
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.layout.tree = function() {
var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false;
function tree(d, i) {
var nodes = hierarchy.call(this, d, i), root = nodes[0];
function firstWalk(node, previousSibling) {
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;
Function brushstart
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function brushstart() {
var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), dragRestore = d3_event_dragSuppress(), center, origin = d3.mouse(target), offset;
var w = d3.select(d3_window).on("keydown.brush", keydown).on("keyup.brush", keyup);
if (d3.event.changedTouches) {
w.on("touchmove.brush", brushmove).on("touchend.brush", brushend);
Function _registerMouseEvents
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_registerMouseEvents: function() {
var element = d3.select(this.element);
var drag = {
Function Local
has 103 lines of code (exceeds 25 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'];
Function quadtree
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.geom.quadtree = function(points, x1, y1, x2, y2) {
var x = d3_geom_pointX, y = d3_geom_pointY, compat;
if (compat = arguments.length) {
x = d3_geom_quadtreeCompatX;
y = d3_geom_quadtreeCompatY;
Function _fnSortingClasses
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnSortingClasses( oSettings )
{
var i, iLen, j, jLen, iFound;
var aaSort, sClass;
var iColumns = oSettings.aoColumns.length;
Function dsv
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.dsv = function(delimiter, mimeType) {
var reFormat = new RegExp('["' + delimiter + "\n]"), delimiterCode = delimiter.charCodeAt(0);
function dsv(url, row, callback) {
if (arguments.length < 3) callback = row, row = null;
var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback);
Function X
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Open
Rickshaw.Graph.Axis.X = function(args) {
var self = this;
var berthRate = 0.10;
- 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 _path2curve
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
path2curve = R._path2curve = cacher(function (path, path2) {
var pth = !path2 && paths(path);
if (!path2 && pth.curve) {
return pathClone(pth.curve);
}
Function _pathToAbsolute
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
pathToAbsolute = R._pathToAbsolute = function (pathArray) {
var pth = paths(pathArray);
if (pth.abs) {
return pathClone(pth.abs);
}
Function defaultPrefilter
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function defaultPrefilter( elem, props, opts ) {
/* jshint validthis: true */
var prop, value, toggle, tween, hooks, oldfire,
anim = this,
orig = {},
Function d3_geo_clipCircle
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function d3_geo_clipCircle(radius) {
var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians);
return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -π, radius - π ]);
function visible(λ, φ) {
return Math.cos(λ) * Math.cos(φ) > cr;
Function Time
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Rickshaw.Fixtures.Time = function() {
var self = this;
this.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];