Showing 426 of 3,050 total issues
Function compareTo
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public compareTo(b: Candidate<T>): -1 | 1 | 0 {
const statesA = this.states;
const statesB = b.states;
for (
Function fromDefinition
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static fromDefinition(
owner: RouterConfiguration,
definition:
| ElementRouteDefinition
| TemplateRouteDefinition
Function getDays
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public getDays(
info: CalendarInfo = this.getMonthInfo(),
minWeeks: number = this.minWeeks
): CalendarDateInfo[][] {
minWeeks = minWeeks > 10 ? 10 : minWeeks;
- 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 createContext
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function createContext<K extends Key>(
nameConfigOrCallback?:
| string
| ((builder: ResolverBuilder<K>) => Resolver<K>)
| InterfaceConfiguration,
- 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 CheckableFormAssociated
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function CheckableFormAssociated<T extends ConstructableFormAssociated>(
BaseCtor: T
): T {
interface C extends FormAssociatedElement {}
class C extends FormAssociated(BaseCtor) {}
Function selectTemplate
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function selectTemplate<T extends FASTSelect>(
options: SelectOptions = {}
): ElementViewTemplate<T> {
return html<T>`
<template
Function comboboxTemplate
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function comboboxTemplate<T extends FASTCombobox>(
options: ComboboxOptions = {}
): ElementViewTemplate<T> {
return html<T>`
<template
Function handleKeydown
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public handleKeydown(e: KeyboardEvent): void {
// if the cell does not have an internal focus queue we can ignore keystrokes
if (
e.defaultPrevented ||
this.columnDefinition === null ||
FASTTooltip
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
export class FASTTooltip extends FASTElement {
/**
* The visibility of the tooltip.
*
* @internal
Function computedState
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function computedState<T>(
initialize: ComputedInitializer<T>,
name = "ComputedState"
): ComputedState<T> {
let setupCallback: ComputedSetupCallback | null = null;
File tabs.ts
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { attr, FASTElement, observable } from "@microsoft/fast-element";
import {
keyArrowDown,
keyArrowLeft,
keyArrowRight,
Function noninteractiveCalendarTemplate
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function noninteractiveCalendarTemplate<T extends FASTCalendar>(
options: CalendarOptions,
todayString: string
): ViewTemplate<T> {
return html<T>`
Function textAreaTemplate
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function textAreaTemplate<T extends FASTTextArea>(
options: TextAreaOptions = {}
): ElementViewTemplate<T> {
return html<T>`
<label
Function keydownHandler
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public keydownHandler(e: Event & KeyboardEvent): boolean | void {
const key = e.key;
if (e.ctrlKey || e.shiftKey) {
return true;
- 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 getAll
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public getAll<K extends Key>(
key: K,
searchAncestors: boolean = false
): readonly Resolved<K>[] {
validateKey(key);
- 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 defineProperty
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
defineProperty(
target: {},
propertyName: string,
key: Key,
respectConnection = false
- 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 createElementTemplate
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function createElementTemplate<TSource = any, TParent = any>(
tagName: string,
options?: ElementCreateOptions
): ViewTemplate<TSource, TParent> {
const markup: Array<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 keydownHandler
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public keydownHandler(e: Event & KeyboardEvent): boolean | void {
const key = e.key;
if (e.ctrlKey || e.shiftKey) {
return true;
Function merge
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function merge(splice: Splice, splices: Splice[]): void {
let inserted = false;
let insertionOffset = 0;
for (let i = 0; i < splices.length; i++) {
ElementController
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
export class ElementController<TElement extends HTMLElement = HTMLElement>
extends PropertyChangeNotifier
implements HostController<TElement>
{
private boundObservables: Record<string, any> | null = null;