Showing 207 of 537 total issues
Avoid deeply nested control flow statements. Open
Open
for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);
Consider simplifying this complex logical expression. Open
Open
if (Math.abs(endX - startX) > epsilon$3 || Math.abs(endY - startY) > epsilon$3) {
halfedges.splice(iHalfedge, 0, edges.push(createBorderEdge(site, end,
Math.abs(endX - x0) < epsilon$3 && y1 - endY > epsilon$3 ? [x0, Math.abs(startX - x0) < epsilon$3 ? startY : y1]
: Math.abs(endY - y1) < epsilon$3 && x1 - endX > epsilon$3 ? [Math.abs(startY - y1) < epsilon$3 ? startX : x1, y1]
: Math.abs(endX - x1) < epsilon$3 && endY - y0 > epsilon$3 ? [x1, Math.abs(startX - x1) < epsilon$3 ? startY : y0]
Function arcTo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
arcTo: function(x1, y1, x2, y2, r) {
Function connectEdge
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function connectEdge(edge, x0, y0, x1, y1) {
Function Quad
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function Quad(node, x0, y0, x1, y1) {
Function treemapDice
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function treemapDice(parent, x0, y0, x1, y1) {
Function apply
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function apply(quad, x0, y0, x1, y1) {
Function clipPolygon
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function clipPolygon(segments, compareIntersection, startInside, interpolate, stream) {
Function basis$1
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function basis$1(t1, v0, v1, v2, v3) {
Function resquarify
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function resquarify(parent, x0, y0, x1, y1) {
Function clipEdge
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function clipEdge(edge, x0, y0, x1, y1) {
Function beforestart
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function beforestart(id, container, point, that, args) {
Function squarify
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function squarify(parent, x0, y0, x1, y1) {
Function binary
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function binary(parent, x0, y0, x1, y1) {
Function sliceDice
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function sliceDice(parent, x0, y0, x1, y1) {
Function treemapSlice
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function treemapSlice(parent, x0, y0, x1, y1) {
Function 6
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
},{"./drawers/circles":2,"./drawers/lines":3,"d3":6,"seed-random":7}],6:[function(require,module,exports){
// https://d3js.org Version 4.1.1. Copyright 2016 Mike Bostock.
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
- 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
Avoid too many return
statements within this function. Open
Open
return parent[j] = node, parent[i] = leaf, tree;
Avoid too many return
statements within this function. Open
Open
else if (v0[0] < x0) return;
Avoid too many return
statements within this function. Open
Open
if (previous) return (next ? previous.next = next : delete previous.next), this;