Showing 333 of 1,891 total issues
Function __drawPoints
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const __drawPoints = (
ctx: CanvasRenderingContext2D,
opts: IObjectOf<any>,
pts: Iterable<ReadonlyVec>,
cmd: "fill" | "stroke",
- 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 wrap
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const wrap: FnN3 = (x, min, max) => {
if (min === max) return min;
if (x > max) {
const d = max - min;
x -= d;
- 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 assert
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
? (test: boolean | (() => boolean), msg?: string | (() => string)) => {
if ((typeof test === "function" && !test()) || !test) {
throw new AssertionError(
typeof msg === "function" ? msg() : msg
);
- 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 __drawPoints
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const __drawPoints = (
ctx: CanvasRenderingContext2D,
opts: IObjectOf<any>,
pts: ArrayLike<number>,
cmd: "fill" | "stroke",
- 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 cohesion
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const cohesion = (
maxDist: ScalarOrField,
weight: ScalarOrField = 1
): IBoidBehavior => {
const $maxDist = __ensureFn(maxDist);
- 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 spacesToTabsLine
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const spacesToTabsLine = (line: string, tabSize = 4) => {
const re = /\s{2,}/g;
let i = 0;
let res = "";
let m: RegExpExecArray | null;
- 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 compareLex
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const compareLex: Comparator<string> = (a, b) => {
const ma = BOUNDARY.exec(a);
const mb = BOUNDARY.exec(b);
return ma && mb
? __compare2(
- 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 __mapSubject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
(subject: any) =>
([p, o]: [any, any]) => {
if (isArray(o)) {
return mapcat(
(o) =>
- 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 limitSolutions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const limitSolutions = (n: number) =>
map((sol: Solutions) => {
if (sol.size <= n) {
return sol;
}
- 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
Avoid too many return
statements within this function. Open
return true;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return r(
acc,
fromUtf8CodePoint(
((u0 & 1) << 30) |
(u1 << 24) |
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return r(
acc,
fromUtf8CodePoint(
((u0 & 3) << 24) |
(u1 << 18) |
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return -b.compare(a);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return a < b ? -1 : a > b ? 1 : 0;
- Create a ticketCreate a ticket
Function blit2d
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function blit2d(
dest: any[],
dpos: ArrayLike<number>,
dsize: ArrayLike<number>,
src: ArrayLike<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 zip
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function* zip(...src: Iterable<any>[]): IterableIterator<any[]> {
const iters = src.map((s) => s[Symbol.iterator]());
while (true) {
const tuple = [];
for (let i of iters) {
- 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 concat
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const concat = <T>(
...args: Nullable<ISeq<T> | ISeqable<T>>[]
): Maybe<ISeq<T>> => {
const seqs: ISeq<T>[] = [];
for (let i = 0, n = args.length; i < n; i++) {
- 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 suffixes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
*suffixes(prefix: K, withPrefix = false, sep = "") {
const node = this.find(prefix);
if (node) {
yield* node.keys(
sep,
- 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 add
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
add(key: K, val: V) {
// eslint-disable-next-line no-this-alias -- tree traversal
let node: MultiTrie<K, V> = this;
for (let i = 0, n = key.length; i < n; i++) {
const k = key[i].toString();
- 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 repeatedly3d
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function* repeatedly3d<T>(
fn: FnU3<number, T>,
cols: number,
rows: number,
slices: 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"