Showing 333 of 1,891 total issues
Function compress
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const compress = (m: number, n: number, dense: ArrayLike<number>) => {
const major: number[] = [0];
const minor: number[] = [];
const data: number[] = [];
for (let i = 0, col = 0; col < n; col++) {
- 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 fromDense
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static fromDense(m: number, n: number, data: ArrayLike<number>) {
const res = [];
for (let i = 0, k = 0; i < m; i++) {
for (let j = 0; j < n; j++, k++) {
if (data[k] !== 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 queryNeighborhood
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
queryNeighborhood<N extends INeighborhood<ReadonlyVec, T>>(
neighborhood: N,
opts: Partial<QueryNeighborhoodOpts> = {}
) {
const { entries, indices, items, keyFn, tableSize } = this;
- 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 queryCell
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected queryCell(
dist: VecOpRoVV<number>,
heap: Heap<[number, Nullable<Pair<K, V>>?]>,
c: Pair<K, V>[],
k: 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 meansLatLon
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const meansLatLon: CentroidStrategy = () => {
let lat = 0;
let lon = 0;
let n = 0;
return {
- 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 convolve1d
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function convolve1d(
opts: Convolution1DOpts,
indices?: Iterable<number>
): any {
if (indices) {
- 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 __transform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const __transform = (real: NumericArray, img: NumericArray, n: number) => {
let step = 1;
let prevStep: number;
let i: number, j: number, ii: number, ip: number;
let tr: number, ti: 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 __wrapper
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
<T>(update: Fn2<HTMLElement | SVGElement, T, void>) =>
(tag: string, attribs?: any, body?: T) =>
<WrappedComponent<T>>{
async mount(parent: ParentNode, index: NumOrElement, state: T) {
this.inner = $compile([tag, attribs]);
- 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 broadcast
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const broadcast = async <T>(
src: Channel<T>,
dest: Channel<T>[],
close = 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 varToHiccup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const varToHiccup = (
{ domain: [min, max], terms }: LVar<any>,
opts: Partial<VizualizeVarOpts> = {}
) => {
const {
- 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 __argAttribs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const __argAttribs = (args: any[]) => {
if (args.length) {
const last = args[args.length - 1];
return isPlainObject(last)
? args.pop()
- 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 convolveClosed
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const convolveClosed = (
pts: ReadonlyVec[],
kernel: number[],
t = 0.5,
iter = 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 __argsVN
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const __argsVN = (args: any[]) => {
const attr = __argAttribs(args);
return args.length
? args.length === 2
? [args[0], args[1], attr]
- 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 readPPM
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const readPPM = (
src: Uint8Array,
i: number,
width: 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 __equivMap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const __equivMap = (a: Map<any, any>, b: any) => {
if (a === b) {
return true;
}
if (!(b instanceof Map) || a.size !== b.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 __readFloat
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const __readFloat = (iter: Iterator<number>) => {
let i: IteratorResult<number>;
let x: number;
let acc = "";
while (!(i = iter.next()).done) {
- 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 __outputRaw
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const __outputRaw = async (
opts: OutputSpec,
output: Sharp,
ctx: ImgProcCtx,
outDir: 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 ringGroup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const ringGroup = (opts: RingGroupOpts) => {
const { layout, id, value, label, info } = opts;
const n = value.length;
const nested =
opts.horizontal !== 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 bytes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function bytes(cap = 1024, src?: Iterable<BinStructItem>) {
let view: DataView;
let pos = 0;
const ensure = (acc: Uint8Array, size: 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 indexAt
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
indexAt(t: number) {
const pts = this.points;
const n = pts.length - 1;
if (n < 0) {
return;
- 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"