Showing 231 of 12,131 total issues
Function collect
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static collect(
Owner: Function,
...attributeLists: (ReadonlyArray<string | AttributeConfiguration> | undefined)[]
): ReadonlyArray<AttributeDefinition> {
const attributes: AttributeDefinition[] = [];
- 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 addStyles
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void {
if (!styles) {
return;
}
- 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 compileAttributes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function compileAttributes(
context: CompilationContext,
parentId: string,
node: HTMLElement,
nodeId: string,
- 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 recognize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public async recognize(
path: string,
converters: Readonly<Record<string, RouteParameterConverter>> = {}
): Promise<RecognizedRoute<TSettings> | null> {
const separated = QueryString.separate(path);
- 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 renderProperty
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static *renderProperty(
code: AttributeBindingOp,
value: any,
renderInfo: RenderInfo
) {
- 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
Avoid deeply nested control flow statements. Open
if (typeof Proto === "function" && Proto !== Function.prototype) {
dependencies = cloneArrayWithPossibleProps(
DI.getDependencies(Proto)
);
} else {
Avoid deeply nested control flow statements. Open
for (let i = 0; i < len; ++i) {
key = keys[i];
if (!isArrayIndex(key)) {
dependencies[key] = annotationParamtypes[key];
}
Function calc
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
current: unknown[],
currentStart: number,
currentEnd: number,
old: unknown[],
oldStart: number,
Function calcEditDistances
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
current: any[],
currentStart: number,
currentEnd: number,
old: any[],
oldStart: number,
Function removeStyles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public removeStyles(
styles: ElementStyles | HTMLStyleElement | null | undefined
): void {
if (!styles) {
return;
- 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
Avoid deeply nested control flow statements. Open
if (searchAncestors || !regInChild) {
childExpectation.push(0, 1, 2, 3, 4);
}
Function notify
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public notify(args: any): void {
const spillover = this.spillover;
const subject = this.subject;
if (spillover === 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 collectStyles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function collectStyles(style: ComposableStyles): string {
let content: string = "";
if (typeof style === "string") {
content = style;
} else if (style instanceof CSSStyleSheet) {
- 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
Avoid deeply nested control flow statements. Open
for (let i = 0; i < len; ++i) {
auAnnotationParamtype = annotationParamtypes[i];
if (auAnnotationParamtype !== void 0) {
dependencies[i] = auAnnotationParamtype;
}
Function tryConnect
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private tryConnect() {
if (this.config === null || !this.isConnected) {
return;
}
- 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
Avoid deeply nested control flow statements. Open
if (def) {
factory = factoryFromElementName(def.name);
} else {
throw new Error(
"Invalid value for element in route config."
Function getEventInfo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private getEventInfo(event: MouseEvent): AnchorEventInfo {
const info: AnchorEventInfo = {
shouldHandleEvent: false,
href: null,
anchor: 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 compileAttributes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
context: CompilationContext,
parentId: string,
node: HTMLElement,
nodeId: string,
nodeIndex: number,
Avoid deeply nested control flow statements. Open
if (nextState.nextStates !== null) {
for (const $nextState of nextState.nextStates) {
collectSkippedStates(skippedStates, $nextState);
}
}
Function getParams
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public getParams(): Record<string, string | undefined> {
const { states, chars, endpoint } = this;
const params: Record<string, string | undefined> = {};
// First initialize all properties with undefined so they all exist (even if they're not filled, e.g. non-matched optional params)
- 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"