Showing 366 of 1,904 total issues
Function serialize
has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring. Open
export const serialize = (src: any, opts: Partial<EncodeOpts> = {}) => {
const { initial = 256, resolve } = opts;
let buf = new Uint8Array(initial);
let view = new DataView(buf.buffer);
let pos = 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 stratifiedGrid3
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
export function* stratifiedGrid3(opts: StratifiedGridOpts) {
let { rnd = SYSTEM, separation: sep = Math.SQRT1_2 } = opts;
sep *= sep;
const scale =
opts.scale !== undefined
- 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 process
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
protected async process() {
if (!this.isBusy) {
this.isBusy = true;
const { buf, txbuf, reads, writes } = this;
let doProcess: any = 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 asGeometry
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
export const asGeometry = (
src: Iterable<DrawCommand>,
opts: Partial<AsGeometryOpts> = {}
) => {
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 traceLines
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
export const traceLines = (
opts: TraceOpts,
order: Fn<GridIterOpts2D, Iterable<[number, number]>>,
border: Predicate<[number, number]>,
tx: PointTransform2D,
- 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 deserialize
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
export const deserialize = (
src: Uint8Array | ArrayBufferLike,
start = 0,
end = src.byteLength
) => {
- 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 _normalizeTree
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
const _normalizeTree = (
tree: any,
opts: Partial<HDOMOpts>,
ctx: any,
path: 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 C11
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
export const C11 = (opts: Partial<C11Opts> = {}) => {
const { typePrefix = "" } = opts;
const INDENT = " ";
const SCOPES: [RegExp, RegExp] = [/\{$/, /^\}[ A-Za-z0-9_]*[;,]?$/];
- 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 sync
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
export async function* sync<T extends Record<NumOrString, any>>(
src: SyncSources<T>,
opts?: Partial<SyncOpts>
) {
let iters = <{ key: keyof T; id: number; iter: AsyncIterator<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 distanceTransform
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
export const distanceTransform = (
{
data: spix,
size: [width, height],
stride: [sx, sy],
- 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 ZIG
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
export const ZIG = (opts: Partial<ZigOpts> = {}) => {
const INDENT = " ";
const SCOPES: [RegExp, RegExp] = [/\{$/, /(?<!\{.*)\}\)?[;,]?$/];
const gen: ICodeGen = {
- 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 stratifiedGrid2
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
export function* stratifiedGrid2(opts: StratifiedGridOpts) {
let { rnd = SYSTEM, separation: sep = Math.SQRT1_2 } = opts;
sep *= sep;
const scale =
opts.scale !== undefined
- 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
transformScope
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
{
[DEFAULT]: (scope: ParseScope<string>, ctx: TransformCtx) => {
throw new Error(
`unknown ID: ${scope.id}, ctx: ${JSON.stringify(ctx)}`
);
- Create a ticketCreate a ticket
File c11.ts
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { topoSort } from "@thi.ng/arrays/topo-sort";
import { isString } from "@thi.ng/checks/is-string";
import { unsupported } from "@thi.ng/errors/unsupported";
import { capitalize } from "@thi.ng/strings/case";
import type {
- Create a ticketCreate a ticket
Function el
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
el: ({ children }, opts, acc) => {
const [name, { children: $attribs }, body] = children!;
if (opts.ignoreElements?.includes(name.result)) return;
const attribs: any = {};
const el: Element = [name.result, 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 outputProc
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export const outputProc: Processor = async (spec, input, ctx) => {
const opts = <OutputSpec>spec;
const outDir = resolve(ctx.opts.outDir || ".");
let output = input.clone();
if (opts.blurhash) {
- 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
DEFAULT_TAG_TRANSFORMS
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
export const DEFAULT_TAG_TRANSFORMS: TagTransforms = {
bold: (_, body) => ["strong", {}, ...body],
blockquote: (_, body, meta) => ["blockquote", withMeta({}, meta), ...body],
br: () => ["br", {}],
code: (_, body) => ["code", {}, body],
- Create a ticketCreate a ticket
Function readFloat
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
const readFloat = (src: string, index: number) => {
index = skipWS(src, index);
let signOk = true;
let dotOk = true;
let expOk = 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 dropdown
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
export const dropdown = (
gui: IMGUI,
layout: IGridLayout<any> | LayoutBox,
id: string,
sel: 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 __points
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function* __points(
pts: ReadonlyVec[],
attribs?: Attribs,
opts?: Partial<AsAxiDrawOpts>
): IterableIterator<DrawCommand> {
- 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"