Showing 333 of 1,891 total issues
Avoid deeply nested control flow statements. Open
if (
neighborhood.includesPosition(
keyFn(items[entries[i]])
)
)
- Create a ticketCreate a ticket
Function orderedDither
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const orderedDither = (
img: IntBuffer,
size: BayerSize | BayerMatrix,
numColors: number | 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
Avoid deeply nested control flow statements. Open
if (last) curr.push(p);
- Create a ticketCreate a ticket
Function toHiccup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
toHiccup() {
const attribs = this.attribs;
const acc: any[] = ["g", { fill: "none", ...attribs }];
if (attribs && attribs.res) {
const res = attribs.res - 1;
- 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 __simpleDiff
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const __simpleDiff = <T>(
state: ArrayDiff<T>,
src: ArrayLike<T>,
key: "adds" | "dels",
logDir: 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 buttonRaw
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const buttonRaw = (
gui: IMGUI,
id: string,
shape: IShape,
hash: Hash,
- 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 fitAllIntoBounds2
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const fitAllIntoBounds2 = (shapes: IShape2[], dest: Rect) => {
const sbraw = __collBounds(shapes, bounds);
if (!sbraw) return;
const src = new Rect(...sbraw);
const sx = safeDiv(dest.size[0], src.size[0]);
- 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 sort
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
sort() {
const sorted: T[] = [];
const g = this.copy();
let queue = new ArraySet(g.leaves());
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
Avoid deeply nested control flow statements. Open
if (prevBorder) {
if (n > min) $record();
curr = [p];
} else {
if (n >= min) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (down) {
y++;
d++;
ny = 0;
} else {
- Create a ticketCreate a ticket
Function __circleOpts
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const __circleOpts = (
opts: number | Partial<SamplingOpts>,
r: number
): [number, number, boolean] =>
isNumber(opts)
- 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 dialRaw
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const dialRaw = (
gui: IMGUI,
id: string,
x: number,
y: 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 normalize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const normalize = (tag: any[]) => {
let name = tag[0];
let match: RegExpExecArray | null;
const hasAttribs = isPlainObject(tag[1]);
const attribs: any = hasAttribs ? { ...tag[1] } : {};
- 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 deeply nested control flow statements. Open
if (yy >= 0 && yy < height && xx >= 0 && xx < width) {
data[yy * width + xx] += (err * weights[j]) >> shift;
}
- Create a ticketCreate a ticket
Function hilbert2d
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function* hilbert2d(opts: GridIterOpts2D) {
const { cols, rows, tx } = __opts(opts);
let hIndex = 0; // hilbert curve index
let hOrder = 0; // hilbert curve order
// fit to number of buckets
- 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 __ftransforms
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const __ftransforms = (attribs: Attribs) => {
let v: any;
if (
(v = attribs.transform) ||
attribs.translate ||
- 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 set
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
set(key: K, val: V) {
const $this = __private.get(this)!;
const { cmp, p, rnd } = $this;
let node: Maybe<Node<K, V>> = this.findNode(key);
if (node.k !== undefined && cmp(node.k, key) === 0) {
- 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 implementations
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const implementations = (
id: PropertyKey,
rels: IObjectOf<MultiFn<any>[]>,
...impls: (MultiFn<any> | Implementation<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 mixin
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const mixin = (behaviour: any, sharedBehaviour: any = {}) => {
const instanceKeys = Reflect.ownKeys(behaviour);
const sharedKeys = Reflect.ownKeys(sharedBehaviour);
const typeTag = Symbol("isa");
- 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 positions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
*positions() {
const { data, n } = this;
for (let i = 0; i < n; i += 8) {
const x = data[i >>> 3];
if (!x) continue;
- 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"