Showing 362 of 1,895 total issues
Function range3d
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function* range3d(
...args: number[]
): IterableIterator<[number, number, number]> {
let fromX!: number, toX!: number, stepX!: number;
let fromY!: number, toY!: number, stepY!: number;
- Read upRead up
- Create a ticketCreate a ticket
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 group
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
group: ($: Group) => {
const { attribs, children } = $;
const attr = { ...DEFAULT_ATTRIBS, ...__sdfAttribs(attribs) };
__validateAttribs(attr);
const $children = children.map(asSDF);
- Read upRead up
- Create a ticketCreate a ticket
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 concatA
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const concatA = <T>(...args: Nullable<ArrayLike<T>>[]) => {
const seqs: ArrayLike<T>[] = [];
for (let i = 0, n = args.length; i < n; i++) {
const x = args[i];
x && x.length && seqs.push(x);
- Read upRead up
- Create a ticketCreate a ticket
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 wrapSides
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function* wrapSides<T>(
src: Iterable<T>,
numLeft = 1,
numRight = numLeft
): IterableIterator<T> {
- Read upRead up
- Create a ticketCreate a ticket
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 halton
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function* halton(base: number) {
let n = 0;
let d = 1;
let invB = 1 / base;
while (true) {
- Read upRead up
- Create a ticketCreate a ticket
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 alt
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
<T>(parsers: Parser<T>[]): Parser<T> =>
(ctx) => {
if (ctx.done) return false;
for (let i = 0, n = parsers.length; i < n; i++) {
if (parsers[i](ctx)) {
- Read upRead up
- Create a ticketCreate a ticket
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 diamondSquare
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function* diamondSquare(exp: number) {
const size = 1 << exp;
const size1 = size + 1;
const s2 = size >> 1;
let res = size;
- Read upRead up
- Create a ticketCreate a ticket
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 svgDoc
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const svgDoc = (attribs: Attribs, ...xs: IShape[]) => {
attribs = { ...DEFAULT_ATTRIBS, ...attribs };
if (xs.length > 0) {
if (!attribs.viewBox) {
const cbounds = __collBounds(xs, bounds);
- Read upRead up
- Create a ticketCreate a ticket
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 getAllIDs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getAllIDs(ids: Iterable<number>, fail = false) {
const index = this.rev;
const res: T[] = [];
for (let id of ids) {
const k = index.get(id);
- Read upRead up
- Create a ticketCreate a ticket
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 findNode
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected findNode(key: K) {
let { cmp, head } = __private.get(this)!;
let node: Node<K, V> = head;
let next: Maybe<Node<K, V>>;
let down: Maybe<Node<K, V>>;
- Read upRead up
- Create a ticketCreate a ticket
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 processedPoints
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function* processedPoints(
{ xaxis, yaxis, project }: VizSpec,
data: DomainValues,
pointOnly = false
): IterableIterator<any> {
- Read upRead up
- Create a ticketCreate a ticket
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 serializeTag
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const serializeTag = (tree: any[], opts: SerializeOpts, path: any[]) => {
tree = normalize(tree);
const attribs = tree[1];
if (attribs.__skip || attribs.__serialize === false) return "";
opts.keys && attribs.key === undefined && (attribs.key = path.join("-"));
- Read upRead up
- Create a ticketCreate a ticket
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 diffObjectDist
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const diffObjectDist = (
a: Nullable<IObjectOf<any>>,
b: Nullable<IObjectOf<any>>,
_equiv: Predicate2<any>
) => {
- Read upRead up
- Create a ticketCreate a ticket
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 getAll
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getAll(keys: Iterable<T>, fail = false) {
const index = this.fwd;
const res: number[] = [];
for (let k of keys) {
const id = index.get(k);
- Read upRead up
- Create a ticketCreate a ticket
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 __apply
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const __apply = ($: IShape) => {
let attribs = $.attribs;
if (!attribs) return $;
const { transform: tx, translate: t, rotate: r, scale: s } = attribs;
if (tx)
- Read upRead up
- Create a ticketCreate a ticket
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 zip
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export async function* zip(
...src: MaybeAsyncIterable<any>[]
): AsyncIterableIterator<any[]> {
const iters: (Iterator<any> | AsyncIterator<any>)[] = src.map(
(s: any) => s[Symbol.iterator]?.() || s[Symbol.asyncIterator]?.()
- Read upRead up
- Create a ticketCreate a ticket
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 scatter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const scatter = (
shape: IShape,
num: number,
rnd = SYSTEM,
out: Vec[] = []
- Read upRead up
- Create a ticketCreate a ticket
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 polyline
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
polyline: ($: Polyline, d) => {
const chunks: Vec[][] = [];
let pts = $.points;
while (true) {
const sampler = new Sampler(pts);
- Read upRead up
- Create a ticketCreate a ticket
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 __drawSolid2D
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const __drawSolid2D = <T extends any[] | TypedArray, P>(
pts: Nullable<Iterable<ArrayLike<number>>>,
grid: IGrid2D<T, P>,
val: P
) => {
- Read upRead up
- Create a ticketCreate a ticket
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 sampleUniform
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
sampleUniform(dist: number, includeLast = false, result: Vec[] = []) {
const { index, points } = this;
const total = this.totalLength();
const delta = dist / total;
const n = index.length;
- Read upRead up
- Create a ticketCreate a ticket
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"