Showing 366 of 1,902 total issues
File easing.ts
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { FnBody1 } from "@thi.ng/shader-ast";
import { F } from "@thi.ng/shader-ast/api/types";
import { ifThen, ternary } from "@thi.ng/shader-ast/ast/controlflow";
import { defn, ret } from "@thi.ng/shader-ast/ast/function";
import {
- Create a ticketCreate a ticket
Function __serialize
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
const __serialize = (tree: any, ctx: any, state: SerializeState): string => {
if (tree == null) return "";
if (Array.isArray(tree)) {
if (!tree.length) {
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 circle
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export const circle = (
canvas: Canvas,
cx: number,
cy: number,
r: 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 fillPoly
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export const fillPoly = <T extends any[] | TypedArray, P>(
grid: IGrid2D<T, P>,
pts: ArrayLike<number>[],
val: P | Shader2D<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 utf8Length
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export const utf8Length = (str: string) => {
const n = str.length;
let len = 0;
for (let i = 0; i < n; ++i) {
let u = str.charCodeAt(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 drawInstanced
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
const drawInstanced = (gl: WebGLRenderingContext, spec: ModelSpec) => {
const isGL2 = isGL2Context(gl);
const ext = !isGL2 ? gl.getExtension("ANGLE_instanced_arrays") : undefined;
if (!(isGL2 || ext)) {
error("instancing not supported");
- 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 list
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
list: (scope, ctx, acc) => {
const children = scope.children![0].children!;
const stack: any[][] = [
[children[0].id === "ulitem" ? "ul" : "ol"],
];
- 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 defuzz
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export const defuzz = <I extends LVarSet<string>, O extends LVarSet<string>>(
ins: I,
outs: O,
rules: Rule<I, O>[],
vals: Partial<Record<keyof I, 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 update
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
async update(curr: T[]) {
if (!curr) return;
const { keyFn, items, ctor, cache, el: parent } = this;
const currItems: KListItem[] = [];
const currCache = new Map<NumOrString, KListItem>();
- 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 computeDiff
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export const computeDiff = (a: string, b: string) => {
const edits = diffArray(
a.split("\n"),
b.split("\n"),
"only-distance-linear"
- 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 22 (exceeds 5 allowed). Consider refactoring. Open
export const fieldType = (
f: Field,
parent: Struct | Union | FuncPointer,
coll: TypeColl,
opts: CodeGenOpts
- 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 expand
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export const expand = (
acc: string[],
parent: any[],
rules: any[],
opts: CSSOpts
- 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 normalizeChildren
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
const normalizeChildren = (
norm: any[],
nattribs: any,
opts: Partial<HDOMOpts>,
ctx: 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
File comp.ts
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { Fn, FnA, FnAny, FnAnyA } from "@thi.ng/api";
import { illegalArity } from "@thi.ng/errors/illegal-arity";
/**
* Returns the right-to-left composition of given functions. I.e. when
- Create a ticketCreate a ticket
Function constructor
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
constructor(...args: any[]) {
let id, buf, tx, err;
let [a, b] = args;
switch (args.length) {
case 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 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, string | undefined>,
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
File ops.ts
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { IObjectOf } from "@thi.ng/api";
import { isNumber } from "@thi.ng/checks/is-number";
import type { Assign, Op1, Op2, Sym, Term } from "../api/nodes.js";
import type { ComparisonOperator, Operator } from "../api/ops.js";
import type {
- Create a ticketCreate a ticket