Showing 333 of 1,891 total issues
Function mergeMapWith
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const mergeMapWith = <K, V>(
f: Fn2<V, V, V>,
dest: Map<K, V>,
...maps: Nullable<Map<K, V>>[]
) => {
- 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
Consider simplifying this complex logical expression. Open
if (
glob &&
(always ||
(typeof process !== "undefined" && process.env !== undefined
? process.env.NODE_ENV !== "production" ||
- Create a ticketCreate a ticket
Function next
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
next() {
let v: number;
switch (this._phase) {
case EnvPhase.IDLE:
return 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 conjugate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function conjugate(src: NumericArray | ComplexArray, isImg = true): any {
if (isComplex(src)) {
const n = src[0].length;
const res = complexArray(n * 2);
const [sreal, simg] = <ComplexArray>src;
- 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 setAt
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
setAt(m: number, n: number, v: number, safe = true) {
safe && ensureIndex2(m, n, this.m, this.n);
const d = this.data;
for (let i = 0, l = d.length; i < l; i += 3) {
const r = d[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 fuzzyMatch
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const fuzzyMatch = <T>(
domain: ArrayLike<T>,
query: ArrayLike<T>,
equiv: Predicate2<any> = _eq
) => {
- 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 xfPrint
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const xfPrint = (fn: Fn<string, void> = console.log) => {
const $print: ScopeTransform<any> = (scope, _, level = 0) => {
if (!scope) return;
const prefix = __indent(level);
const state = scope.state;
- 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 find
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected find(k: K, eps: number) {
if (eps > 0) {
const res = this.query(k, EPS, 1);
return res.length ? res[0] : 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 normRange
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function* normRange(
n: number,
includeLast = true,
reverse = false
): IterableIterator<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 readPBM
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const readPBM = (
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 process
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected async process() {
for await (let val of this.src) {
const topic = this.topicFn(val);
const subs = this.topics.get(topic);
if (!(subs && subs.length)) 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"
Further reading
Function __diffObjectFull
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const __diffObjectFull = (
a: Nullable<IObjectOf<any>>,
b: Nullable<IObjectOf<any>>,
_equiv: Predicate2<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 __readInt
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const __readInt = (iter: Iterator<number>, acc: number, end = Lit.END) => {
let i: IteratorResult<number>;
let x: number;
let isSigned = false;
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 __sampleAttribs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const __sampleAttribs = (
opts?: number | Partial<SamplingOpts>,
attribs?: Attribs
): Maybe<number | Partial<SamplingOpts>> => {
if (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 diagonalEnds2d
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function* diagonalEnds2d(opts: GridIterOpts2D & { all?: boolean }) {
const { cols, rows, tx } = __opts(opts);
const num = cols * rows - 1;
const maxX = cols - 1;
const maxY = rows - 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 merge
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const merge: FnU2<VClock> = (a, b) =>
[...__uniqueIDs(a, b)].reduce((acc, id) => {
const va = a[id];
const vb = b[id];
acc[id] =
- 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 percolateDown
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected percolateDown(i: number, vals = this.values) {
const n = vals.length;
const d = this.d;
const node = vals[i];
const cmp = this.compare;
- 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 __compileSpec
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const __compileSpec = ({
rule,
kernel,
positional,
states,
- 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 __generateFields
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const __generateFields = (
gen: ICodeGen,
parent: Struct | Union,
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 __files
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function* __files(
dir: string,
match: string | RegExp | Predicate<string> = "",
logger?: ILogger,
maxDepth = Infinity,
- 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"