Showing 623 of 1,229 total issues
Function nest
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.nest = function() {
var nest = {}, keys = [], sortKeys = [], sortValues, rollup;
function map(mapType, array, depth) {
if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array;
var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values;
Function exports
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
grunt.initConfig({
clean: ['coverage'],
jshint: {
files: src
Function exports
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(options) {
var cipher = encryptor(options.encryptionSecret);
var oauth = getOAuth();
var router = new express.Router();
Function extractUp
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function extractUp(tree, id) {
var _n = {};
var __n = {};
var _d = {};
Function addEdge
has 61 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 extractUp
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function extractUp(tree, id) {
var _n = {};
var __n = {};
var _d = {};
Function registerId
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
FnScope.prototype.registerId = function(id) {
if (id.name) {
function findVar(scope, name) {
for (var _var in scope._var) {
- 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 Deferred
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Deferred: function( func ) {
var tuples = [
// action, add listener, listener list, final state
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
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 clipLine
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function clipLine(listener) {
var point0, c0, v0, v00, clean;
return {
lineStart: function() {
v00 = v0 = false;
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 setupDrop
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setupDrop(dropbox, opts) {
if (!FileReaderJS.enabled) {
return;
}
Function _getStats
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _getStats(v1, v2) {
var a,
k,
i,
l,
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 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 bootstrap
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function bootstrap(app, iop) {
var io;
if (!iop) {
var server = app.listen(app.get('port'));
Function build
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function build(tree) {
_down = {};
_up = {};
Function addRenderer
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
sigma.prototype.addRenderer = function(options) {
var id,
fn,
camera,
renderer,
Function extractDown
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function extractDown(tree, id) {
var _n = {};
var __n = {};
var _d = {};