Showing 231 of 12,131 total issues
Function traverse
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function traverse(node: DefaultTreeNode | DefaultTreeParentNode, visitor: Visitor) {
// Templates parsed with `parse()` are parsed as full documents and will contain
// html, body tags whether the template contains them or not. Skip over visiting and
// leaving these elements if there is no source-code location, because that indicates
// they are not in the template 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 inject
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
inject(
...dependencies: Key[]
): (
target: any,
key?: string | number,
Function create
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function create(options: any): RenderInstruction {
const name = options.name ?? defaultViewName;
let template: ContentTemplate;
if (isElementRenderOptions(options)) {
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public constructor(element: TElement, definition: FASTElementDefinition) {
super(element);
this.source = element;
this.definition = definition;
Function updateTokenList
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateTokenList(
this: HTMLBindingDirective,
target: Element,
aspect: string,
value: any
Function addTargetDescriptor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private addTargetDescriptor(
parentId: string,
targetId: string,
targetIndex: number
): void {
Function buildParam
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildParam(key: string, value: any, traditional?: boolean): Array<string> {
let result: string[] = [];
if (value === null || value === undefined) {
return result;
Function refreshView
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private refreshView() {
let view = this.view;
const template = this.template;
if (view === null) {
Function get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
get: function (this: any) {
let value = this[field];
if (value === void 0) {
const container: Container =
Function resolveAsync
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public resolveAsync(handler: Container, requestor: Container) {
switch (this.strategy) {
case ResolverStrategy.singleton: {
if (this.resolving) {
throw FAST.error(Message.cyclicDependency, { name: this.state.name });
Function bind
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public bind(source: TSource, context: ExecutionContext<TParent> = this): void {
if (this.source === source) {
return;
}
Function bind
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
bind(controller: ViewController): void {
const target = controller.targets[this.targetNodeId];
switch (this.aspectType) {
case DOMAspect.event:
Function getEventInfo
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private getEventInfo(event: MouseEvent): AnchorEventInfo {
const info: AnchorEventInfo = {
shouldHandleEvent: false,
href: null,
anchor: null,
Function constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public constructor(
public readonly prevState: AnyState<T> | null,
public readonly segment: AnySegment<T> | null,
public readonly value: string
) {
Function assignAspect
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
assignAspect(directive: Aspected, value?: string): void {
if (!value) {
directive.aspectType = DOMAspect.content;
return;
}
Function recognize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async recognize(path: string): Promise<RouteMatch<TSettings> | null> {
const result = await this.recognizer.recognize(path, this.aggregateConverters());
if (result !== null) {
return {
Function refreshView
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private refreshView() {
let view = this.view;
const template = this.template;
if (view === 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 fixture
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export async function fixture<TElement = HTMLElement>(
templateNameOrType: ViewTemplate | string | Constructable<TElement>,
options: FixtureOptions = {}
): Promise<Fixture<TElement>> {
const document = options.document || globalThis.document;
- 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 bind
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public bind(source: TSource, context: ExecutionContext<TParent> = this): void {
if (this.source === source) {
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 elementChanged
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
elementChanged() {
if (this.element) {
const dispatch = this.element.dispatchEvent;
Reflect.defineProperty(this.element, "dispatchEvent", {
value: (event: Event) => {
- 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"