Showing 207 of 537 total issues
Function packEnclose
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function packEnclose(circles) {
if (!(n = circles.length)) return 0;
var a, b, c, n;
Function create
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function create(node, id, self) {
var schedules = node.__transition,
tween;
// Initialize the self timer when the transition is created.
Function pie
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function pie() {
var value = identity$1,
sortValues = descending$1,
sort = null,
startAngle = constant$1(0),
Function clipPolygon
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function clipPolygon(segments, compareIntersection, startInside, interpolate, stream) {
var subject = [],
clip = [],
i,
n;
Function clipEdge
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function clipEdge(edge, x0, y0, x1, y1) {
var a = edge[0],
b = edge[1],
ax = a[0],
ay = a[1],
Function tree_find
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function tree_find(x, y, radius) {
var data,
x0 = this._x0,
y0 = this._y0,
x1,
Function albersUsa
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function albersUsa() {
var cache,
cacheStream,
lower48 = albers(), lower48Point,
alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338
Function e
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
- 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 connectEdge
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function connectEdge(edge, x0, y0, x1, y1) {
var v1 = edge[1];
if (v1) return true;
var v0 = edge[0],
Function clipLine
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function clipLine(a, b, x0, y0, x1, y1) {
var ax = a[0],
ay = a[1],
bx = b[0],
by = b[1],
Function parseRows
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parseRows(text, f) {
var EOL = {}, // sentinel value for end-of-line
EOF = {}, // sentinel value for end-of-file
rows = [], // output rows
N = text.length,
Function interpolateTransform
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function interpolateTransform(parse, pxComma, pxParen, degParen) {
function pop(s) {
return s.length ? s.pop() + " " : "";
}
Function ribbon
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ribbon() {
var source = defaultSource,
target = defaultTarget,
radius = defaultRadius$1,
startAngle = defaultStartAngle,
Function stratify
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function stratify() {
var id = defaultId,
parentId = defaultParentId;
function stratify(data) {
Function point
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
point: function(lambda, phi) {
var point1 = [lambda, phi],
point2,
v = visible(lambda, phi),
c = smallRadius
Function newInterval
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function newInterval(floori, offseti, count, field) {
function interval(date) {
return floori(date = new Date(+date)), date;
}
Function nest
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function nest() {
var keys = [],
sortKeys = [],
sortValues,
rollup,
Function move
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function move() {
var t;
dx = point[0] - point0[0];
dy = point[1] - point0[1];
Function format
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function format(value) {
var valuePrefix = prefix,
valueSuffix = suffix,
i, n, c;
Function PathString
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function PathString() {
var pointCircle = circle$2(4.5),
string = [];
var stream = {