Showing 494 of 3,420 total issues
Function addBehavior
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public addBehavior(behavior: HostBehavior<TElement>) {
const targetBehaviors = this.behaviors ?? (this.behaviors = new Map());
const count = targetBehaviors.get(behavior) ?? 0;
if (count === 0) {
- Read upRead up
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 tunnel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private async tunnel(phase: NavigationPhase) {
const route = this.childRoute;
const contributor = this.childCommandContributor;
if (route && contributor) {
- Read upRead up
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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static create<TSource = any, TParent = any>(
strings: string[],
values: TemplateValue<TSource, TParent>[],
policy?: DOMPolicy
): ViewTemplate<TSource, TParent> {
- Read upRead up
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 appendTo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public appendTo(state: AnyState<T>): StaticState<T> {
const {
value,
value: { length },
} = this;
- Read upRead up
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 addTargetDescriptor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private addTargetDescriptor(
parentId: string,
targetId: string,
targetIndex: number
): void {
- Read upRead up
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 labToXYZ
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function labToXYZ(lab: ColorLAB): ColorXYZ {
const fy: number = (lab.l + 16) / 116;
const fx: number = fy + lab.a / 500;
const fz: number = fy - lab.b / 200;
- Read upRead up
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 insertBefore
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public insertBefore(node: Node): void {
if (this.fragment.hasChildNodes()) {
node.parentNode!.insertBefore(this.fragment, node);
} else {
const end = this.lastChild!;
- Read upRead up
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 disconnect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public disconnect() {
if (this.parent === null) {
if (this.navigationQueue !== null) {
this.navigationQueue.disconnect();
this.navigationQueue = null;
- Read upRead up
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 hsvToRGB
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function hsvToRGB(hsv: ColorHSV, alpha: number = 1): ColorRGBA64 {
const c: number = hsv.s * hsv.v;
const x: number = c * (1 - Math.abs(((hsv.h / 60) % 2) - 1));
const m: number = hsv.v - c;
- Read upRead up
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 insertIntoSortedList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function insertIntoSortedList(
list: PixelBox[],
newItem: PixelBox,
sortPriority: (box: PixelBox) => number
): void {
- Read upRead up
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 hslToRGB
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function hslToRGB(hsl: ColorHSL, alpha: number = 1): ColorRGBA64 {
const c: number = (1 - Math.abs(2 * hsl.l - 1)) * hsl.s;
const x: number = c * (1 - Math.abs(((hsl.h / 60) % 2) - 1));
const m: number = hsl.l - c / 2;
- Read upRead up
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 normalize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static normalize(
styles: ComposableStyles | ComposableStyles[] | undefined
): ElementStyles | undefined {
return styles === void 0
? void 0
- Read upRead up
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 6 (exceeds 5 allowed). Consider refactoring. Open
update(increment: boolean) {
if (increment) {
this.value = this.value === 10 ? 0 : this.value + 1;
} else {
this.value = this.value < 2 ? 2 : 0;
- Read upRead up
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 6 (exceeds 5 allowed). Consider refactoring. Open
update(increment: boolean) {
if (increment) {
this.value = this.value === 10 ? 0 : this.value + 1;
} else {
this.value = this.value < 2 ? 2 : 0;
- Read upRead up
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"