Showing 231 of 12,131 total issues
Function buildTitle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public buildTitle(rootTitle: string, routeTitles: string[][]) {
let title = rootTitle;
for (const level of routeTitles) {
if (title) {
- 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 (const [path, match, $params] of tests) {
const leading = hasLeadingSlash ? "/" : "";
const trailing = hasTrailingSlash ? "/" : "";
let title = `should`;
Function fromDefinition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static fromDefinition(
owner: RouterConfiguration,
definition:
| ElementRouteDefinition
| TemplateRouteDefinition
- 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 compile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
compile<TSource = any, TParent = any>(
html: string | HTMLTemplateElement,
factories: Record<string, ViewBehaviorFactory>,
policy: DOMPolicy = DOM.policy
): TemplateCompilationResult<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 computedState
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function computedState<T>(
initialize: ComputedInitializer<T>,
name = "ComputedState"
): ComputedState<T> {
let setupCallback: ComputedSetupCallback | null = 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
Avoid deeply nested control flow statements. Open
if (isString(result)) {
result = instructionToTemplate(
getForInstance(dataBinding.evaluate(s, c), result)
);
} else if (result instanceof Node) {
Function createOutput
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
size: number,
filter: (index: number) => boolean = () => true,
prefix = "",
wrapper = input => input,
fromIndex: number = 0
Function expectAspect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
template: ViewTemplate,
type: T,
sourceAspect: string,
targetAspect: string,
aspectType: number
Function render
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
*render(behaviorFactory, renderInfo, source, renderer, context) {
Function render
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
directive: RepeatDirective,
renderInfo: RenderInfo,
source: any,
renderer: DefaultTemplateRenderer,
context: ExecutionContext
Function render
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
*render(behaviorFactory, renderInfo, source, renderer, context) {
Function render
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
directive: RenderDirective,
renderInfo: RenderInfo,
source: any,
renderer: DefaultTemplateRenderer,
context: ExecutionContext
Function compileContent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
context: CompilationContext,
node: Text,
parentId,
nodeId,
nodeIndex
Function visitObject
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
object: any,
deep: boolean,
visitor: ObjectVisitor<TVisitorData>,
data: TVisitorData,
traversed: WeakSet<any> | Set<any>
Function renderTemplate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private renderTemplate(template: ElementViewTemplate | null | undefined): void {
// When getting the host to render to, we start by looking
// up the shadow root. If there isn't one, then that means
// we're doing a Light DOM render to the element's direct children.
const element = this.source;
- 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 parse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
parse(
value: string,
factories: Record<string, ViewBehaviorFactory>
): (string | ViewBehaviorFactory)[] | null {
const parts = value.split(interpolationStart);
- 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 unsubscribe
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public unsubscribe(subscriber: Subscriber): void {
const spillover = this.spillover;
if (spillover === void 0) {
if (this.sub1 === subscriber) {
- 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 constructor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private constructor(
type: TType,
nameOrConfig: PartialFASTElementDefinition | string = (type as any).definition
) {
if (isString(nameOrConfig)) {
- 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 project
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function project(array: unknown[], changes: Splice[]): Splice[] {
let splices: Splice[] = [];
const initialSplices: Splice[] = [];
for (let i = 0, ii = changes.length; i < ii; i++) {
- 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 getElementRenderer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const getElementRenderer = (
renderInfo: RenderInfo,
tagName: string,
ceClass: typeof HTMLElement | undefined = customElements.get(tagName),
attributes: AttributesMap = new Map()
- 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"