Showing 623 of 1,229 total issues
Consider simplifying this complex logical expression. Open
Open
if ( event.pageX == null && original.clientX != null ) {
eventDoc = event.target.ownerDocument || document;
doc = eventDoc.documentElement;
body = eventDoc.body;
Function generateRoutes
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Overview.prototype.generateRoutes = function() {
this.express.get('/generate', (function(_this) {
return function(req, res) {
var _ref;
if ((_ref = _this.initStatus) != null ? _ref.initializing : void 0) {
File sigma.core.js
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
;(function(undefined) {
'use strict';
var __instances = {};
Function axis
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.svg.axis = function() {
var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, innerTickSize = 6, outerTickSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_;
function axis(g) {
g.each(function() {
var g = d3.select(this);
File sigma.classes.graph.js
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
;(function(undefined) {
'use strict';
var _methods = Object.create(null),
_indexes = Object.create(null),
Function exports
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
var coreJsFiles = [
// Core:
'src/sigma.core.js',
Function support
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.support = (function() {
var support, all, a,
input, select, fragment,
opt, eventName, isSupported, i,
Function addEdge
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addEdge: function(edge, source, target, data, i, prefix, settings) {
var w = (edge[prefix + 'size'] || 1) / 2,
x1 = source[prefix + 'x'],
y1 = source[prefix + 'y'],
x2 = target[prefix + 'x'],
Function build
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
Open
function build(tree) {
_down = {};
_up = {};
- 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 tree
has 114 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 = null;
function tree(d, i) {
var nodes = hierarchy.call(this, d, i), root0 = nodes[0], root1 = wrapTree(root0);
d3_layout_hierarchyVisitAfter(root1, firstWalk), root1.parent.m = -root1.z;
Function render
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
sigma.renderers.canvas.prototype.render = function(options) {
options = options || {};
var a,
i,
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 add
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.add = function(name, timbit, callback) {
timbits.log.info("Placing " + name + " in the box");
timbits.box[name] = timbit;
timbit.name = name;
Function generateRoutes
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Overview.prototype.generateRoutes = function () {
this.express.get('/generate', function (_this) {
return function (req, res) {
var _ref;
if ((_ref = _this.initStatus) != null ? _ref.initializing : void 0) {
Function reduction
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
Open
function reduction(graphParts) {
// Detect if a node has multiple dependencies
var _branches = [];
var _dirty = false;
- 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 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 _handleMove
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _handleMove(e) {
if (!_doubleTap && _settings('touchEnabled')) {
var x0,
x1,
y0,
File sigma.webgl.edges.arrow.js
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
;(function() {
'use strict';
sigma.utils.pkg('sigma.webgl.edges');
File script.js
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
var socket = io.connect('http://localhost:8080');
var logElm = document.getElementById("log");
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;