Showing 258 of 12,136 total issues
Function run
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public async run(router: Router, message: NavigationMessage) {
const events = router.config!.createEventSink();
const match = await router.config!.recognizeRoute(message.path);
if (match === 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 recognize
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async recognize(
path: string,
converters: Readonly<Record<string, RouteParameterConverter>> = {}
): Promise<RecognizedRoute<TSettings> | null> {
const separated = QueryString.separate(path);
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
*render(
directive: HTMLBindingDirective,
renderInfo: RenderInfo,
source: any,
renderer: DefaultTemplateRenderer,
Function buildAPIMarkdown
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function buildAPIMarkdown() {
await copyAPI();
await new Promise((resolve, reject) =>
exec(
Function calcEditDistances
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function calcEditDistances(
current: any[],
currentStart: number,
currentEnd: number,
old: any[],
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public constructor(element: TElement, definition: FASTElementDefinition) {
super(element);
this.source = element;
this.definition = definition;
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
function collectStyles<TSource = any, TParent = any>(
strings: TemplateStringsArray,
values: CSSValue<TSource, TParent>[]
): { styles: ComposableStyles[]; behaviors: HostBehavior<HTMLElement>[] } {
const styles: ComposableStyles[] = [];
- 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 parseComplexParam
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function parseComplexParam(
queryParams: Record<string, any>,
keys: string[],
value: any
): 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 $add
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private $add(route: Route, settings?: TSettings): void {
const path = route.path;
const $route = new ConfigurableRoute(
route.path,
route.name || "",
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
create<TSource = any, TParent = any>(
source: TSource
): ViewBehaviorOrchestrator<TSource, TParent> {
const behaviors: ViewBehavior[] = [];
const targets: ViewBehaviorTargets = {};
- 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 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private constructor(
type: TType,
nameOrConfig: PartialFASTElementDefinition | string = (type as any).definition
) {
if (isString(nameOrConfig)) {
Function bind
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
bind(controller: ViewController): void {
const target = controller.targets[this.targetNodeId];
const isHydrating =
isHydratable(controller) &&
controller.hydrationStage &&
Function collectStyles
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function collectStyles<TSource = any, TParent = any>(
strings: TemplateStringsArray,
values: CSSValue<TSource, TParent>[]
): { styles: ComposableStyles[]; behaviors: HostBehavior<HTMLElement>[] } {
const styles: ComposableStyles[] = [];
Function register
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public register(...params: any[]): Container {
if (++this.registerDepth === 100) {
// Most likely cause is trying to register a plain object that does not have a
// register method and is not a class constructor
throw FAST.error(Message.cannotAutoregisterDependency);
Function compileContent
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function compileContent(
context: CompilationContext,
node: Text,
parentId,
nodeId,
Function parse
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse(queryString: string): Readonly<Record<string, string>> {
const queryParams = {} as Record<string, any>;
if (!queryString || typeof queryString !== "string") {
return queryParams;
}
Function isArrayIndex
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function isArrayIndex(value: unknown): value is number | string {
switch (typeof value) {
case "number":
return value >= 0 && (value | 0) === value;
case "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 get
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public get<K extends Key>(key: K): Resolved<K> {
validateKey(key);
if ((key as Resolver).$isResolver) {
return (key as Resolver).resolve(this, 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 updateTokenList
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function updateTokenList(
this: HTMLBindingDirective,
target: Element,
aspect: string,
value: any
- 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 visitObject
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function visitObject<TVisitorData>(
object: any,
deep: boolean,
visitor: ObjectVisitor<TVisitorData>,
data: TVisitorData,
- 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"