Showing 366 of 1,904 total issues
Function spacesToTabsLine
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const spacesToTabsLine = (line: string, tabSize = 4) => {
const re = /\s{2,}/g;
let i = 0;
let res = "";
let m: RegExpExecArray | null;
- 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 extractBody
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const extractBody = (body: any[], acc: Primitive[] = []) => {
for (let x of isPlainObject(body[1]) ? body.slice(2) : body) {
if (isPrimitive(x)) acc.push(x);
else if (isArray(x)) extractBody(x, 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 wrap
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const wrap: FnN3 = (x, min, max) => {
if (min === max) return min;
if (x > max) {
const d = max - min;
x -= d;
- 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 __drawPoints
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const __drawPoints = (
ctx: CanvasRenderingContext2D,
opts: IObjectOf<any>,
pts: ArrayLike<number>,
cmd: "fill" | "stroke",
- 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 __endShape
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const __endShape = (
ctx: CanvasRenderingContext2D,
attribs: IObjectOf<any>,
doFill = 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 __drawPoints
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const __drawPoints = (
ctx: CanvasRenderingContext2D,
opts: IObjectOf<any>,
pts: Iterable<ReadonlyVec>,
cmd: "fill" | "stroke",
- 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 mapSubject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
(subject: any) =>
([p, o]: [any, any]) => {
if (isArray(o)) {
return mapcat(
(o) =>
- 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 limitSolutions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const limitSolutions = (n: number) =>
map((sol: Solutions) => {
if (sol.size <= n) {
return sol;
}
- 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
Avoid too many return
statements within this function. Open
return true;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return r(
acc,
fromUtf8CodePoint(
((u0 & 1) << 30) |
(u1 << 24) |
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
if (x >= 0xa0 && x <= 0xbf) return $string(x - 0xa0); // fixstr
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return r(
acc,
fromUtf8CodePoint(
((u0 & 3) << 24) |
(u1 << 18) |
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return __serializeIter(tree, ctx, state);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return __serializeIter(tree, ctx, state);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return a < b ? -1 : a > b ? 1 : 0;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return __serialize(tree(ctx), ctx, state);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return [
u * Math.cos(t) - ba3,
u * Math.cos(t - k) - ba3,
u * Math.cos(t - 2 * k) - ba3,
];
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return -b.compare(a);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return __serialize(tree.toHiccup(ctx), ctx, state);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return __serialize(tree.deref(), ctx, state);
- Create a ticketCreate a ticket