Showing 623 of 1,229 total issues
Function _addJob
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _addJob(v1, v2) {
var i,
l,
o;
Function _next
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
function _next(tree, chain, node) {
// TODO What about building this fucking _next function so I don't have to pass these tree and chain as arguments every fucking time !
// console.log(">> ", node, node.kind);
- 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 exports
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function (mongoose, connString) {
if (connString) {
mongoose.connect(connString, function (err) {
// if we failed to connect, abort
- 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
File gexf-parser.js
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
;(function(undefined) {
'use strict';
/**
* GEXF Parser
Function d3_geom_voronoiConnectEdge
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function d3_geom_voronoiConnectEdge(edge, extent) {
var vb = edge.b;
if (vb) return true;
var va = edge.a, x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], lSite = edge.l, rSite = edge.r, lx = lSite.x, ly = lSite.y, rx = rSite.x, ry = rSite.y, fx = (lx + rx) / 2, fy = (ly + ry) / 2, fm, fb;
if (ry === ly) {
Function graticule
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.geo.graticule = function() {
var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5;
function graticule() {
return {
type: "MultiLineString",
Function d3_xhr
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function d3_xhr(url, mimeType, response, callback) {
var xhr = {}, dispatch = d3.dispatch("beforesend", "progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null;
if (d3_window.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest();
"onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() {
request.readyState > 3 && respond();
Function def
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
sigma.canvas.hovers.def = function(node, context, settings) {
var x,
y,
w,
h,
Function d3_svg_area
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function d3_svg_area(projection) {
var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = "L", tension = .7;
function area(data) {
var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() {
return x;
Function quadtree
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function quadtree(data) {
var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_;
if (x1 != null) {
x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2;
} else {
Function matcherFromGroupMatchers
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
// A counter to specify which element is currently being matched
var matcherCachedRuns = 0,
bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
File index.js
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var recast = require("recast");
var b = require("recast").types.builders;
var fs = require("fs");
var util = require("util");
Function isFunction
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Context.prototype.isFunction = function(id) {
// TODO this function is a mess : refactor.
if (id.context) {
Function d3_geo_projectionMutator
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function d3_geo_projectionMutator(projectAt) {
var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) {
x = project(x, y);
return [ x[0] * k + δx, δy - x[1] * k ];
}), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream;
Function add
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add: function( elem, types, handler, data, selector ) {
var tmp, events, t, handleObjIn,
special, eventHandle, handleObj,
handlers, type, namespaces, origType,
elemData = jQuery._data( elem );
Function domManip
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
domManip: function( args, table, callback ) {
// Flatten any nested arrays
args = core_concat.apply( [], args );
Function initProgram
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initProgram: function(gl) {
var vertexShader,
fragmentShader,
program;
Function touchstarted
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function touchstarted() {
var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = ".zoom-" + d3.event.changedTouches[0].identifier, touchmove = "touchmove" + zoomName, touchend = "touchend" + zoomName, targets = [], subject = d3.select(that).on(mousedown, null).on(touchstart, started), dragRestore = d3_event_dragSuppress();
d3_selection_interrupt.call(that);
started();
zoomstarted(dispatch);
Function initInitVars
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Overview.prototype.initInitVars = function() {
this._parseCSV = {
remainingBytes: [],
nextCharCouldBeEscaped: false,
value: false,
Function initInitVars
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Overview.prototype.initInitVars = function () {
this._parseCSV = {
remainingBytes: [],
nextCharCouldBeEscaped: false,
value: false,