Showing 333 of 1,891 total issues
Function floydRivest
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export function floydRivest(
buf: any[] | TypedArray,
k = 1,
cmp: Comparator<any> = compare,
left = 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 defKernel
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export const defKernel = (
tpl: NumericArray | PoolTemplate,
w: number,
h: number,
normalize = false
- 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 toEGFNode
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export const toEGFNode = (
node: Node,
prefix: Fn<string, Maybe<string>>,
propFn: Fn2<string, any, string> = toEGFProp
) => {
- 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 diffTree
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export const diffTree = <T>(
opts: Partial<HDOMOpts>,
impl: HDOMImplementation<T>,
parent: T,
prev: 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 clipPolylinePoly
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export const clipPolylinePoly = (pts: ReadonlyVec[], poly: ReadonlyVec[]) => {
let res: ReadonlyVec[][] = [];
if (pts.length < 2) return res;
let isAInside = pointInPolygon2(pts[0], poly);
for (let i = 0, n = pts.length - 1; 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 encodeBytes
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export const encodeBytes = (src: Uint8Array) => {
const freq = new Uint32Array(FREQ).fill(1);
const out = new BitOutputStream(Math.max(src.length >> 1, 1));
const len = src.length;
let total = FREQ;
- 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 plotLineChart
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export const plotLineChart = (
canvas: Canvas,
x: number,
y: number,
height: 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 __extract
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const __extract = (pts: ReadonlyVec[], maxD: number, order: number) => {
if (pts.length < 2) return { segments: [], points: pts };
const $ = order ? (p: ReadonlyVec) => [p[1], p[0]] : (p: ReadonlyVec) => p;
pts = pts.sort(comparator2(order, order ^ 1));
const segments: VecPair[] = [];
- 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 __sizeOf
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const __sizeOf = (
spec: Field[],
union: boolean,
doAlign: boolean,
bitOffset: 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 fromRAF
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export const fromRAF = (opts: Partial<FromRAFOpts> = {}) =>
isNode()
? fromInterval(16, opts)
: stream<number>((stream) => {
let i = 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 setAttrib
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export const setAttrib = (el: Element, id: string, val: any, attribs?: any) => {
implementsFunction(val, "deref") && (val = val.deref());
if (id.startsWith("__")) return;
const isListener = id[0] === "o" && id[1] === "n";
if (isListener) {
- 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 draw
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export const draw = (
specs: ModelSpec | ModelSpec[],
opts: Partial<DrawFlags> = {}
) => {
const _specs = isArray(specs) ? specs : [specs];
- 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 splice
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
splice(at: ConsCell<T> | number, del = 0, insert?: Iterable<T>): DCons<T> {
let cell: Maybe<ConsCell<T>>;
if (typeof at === "number") {
if (at < 0) {
at += this._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"
Further reading
SortedSet
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
@__inspectable
export class SortedSet<T>
extends Set<T>
implements IEquivSet<T>, ICompare<Set<T>>, IReducible<T, any>
{
- Create a ticketCreate a ticket
File target.ts
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Confirmed
import type { Fn } from "@thi.ng/api";
import { isBoolean } from "@thi.ng/checks/is-boolean";
import { isNumber } from "@thi.ng/checks/is-number";
import { unsupported } from "@thi.ng/errors/unsupported";
import type {
- Create a ticketCreate a ticket
Function formatPath
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const formatPath = (
path: string,
ctx: ImgProcCtx,
spec: OutputSpec,
buf: Buffer | TypedArray
- 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 source
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const source = <T>(
initial?: T,
buffer: IReadWriteBuffer<Maybe<T>> | number = 1
) => {
const queue = isNumber(buffer) ? fifo<Maybe<T>>(buffer) : buffer;
- 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 __fieldType
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const __fieldType = (
f: Field,
coll: TypeColl,
opts: CodeGenOpts,
prefix: string
- 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 __formatCond
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const __formatCond = (cond: any) => {
if (isString(cond)) {
return cond;
}
const acc = [];
- 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 createTree
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const createTree = <T>(
opts: Partial<HDOMOpts>,
impl: HDOMImplementation<T>,
parent: T,
tree: 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"