Showing 231 of 12,131 total issues
Function intersect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function intersect(start1: number, end1: number, start2: number, end2: number): number {
// Disjoint
if (end1 < start2 || end2 < start1) {
return -1;
}
- 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
public constructor(public readonly styles: ReadonlyArray<ComposableStyles>) {
this.behaviors = styles
.map((x: ComposableStyles) =>
x instanceof ElementStyles ? x.behaviors : 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 renderAttribute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static *renderAttribute(
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
Function renderBooleanAttribute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static *renderBooleanAttribute(
code: AttributeBindingOp,
value: unknown,
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
Function removeBehavior
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public removeBehavior(behavior: HostBehavior<TElement>, force: boolean = false) {
const targetBehaviors = this.behaviors;
if (targetBehaviors === null) {
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 uninstallDOMShim
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
uninstallDOMShim(): void {
for (const key of perRequestGlobals) {
if (shimIsInstalledFor(key)) {
if (preShimDescriptors.has(key)) {
Object.defineProperty(globalThis, key, preShimDescriptors.get(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 from
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
from<TBase extends typeof HTMLElement>(
BaseType: TBase
): { new (): InstanceType<TBase> & RouterElement } {
class RouterBase extends (BaseType as any) {
public readonly [routerProperty]!: Router;
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
bind(controller: ViewController): void {
const context = controller.context as RouterExecutionContext;
const options = this.directive.options;
this.contributor = controller.targets[
this.directive.targetNodeId
- 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 aggregate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
aggregate(
parts: (string | ViewBehaviorFactory)[],
policy: DOMPolicy = DOM.policy
): ViewBehaviorFactory {
if (parts.length === 1) {
- 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 compileContent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function compileContent(
context: CompilationContext,
node: Text,
parentId,
nodeId,
- 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 too many return
statements within this function. Open
return end2 - start1; // Overlap
Avoid too many return
statements within this function. Open
return end1 - start1; // Contained
Avoid too many return
statements within this function. Open
return 1;
Avoid too many return
statements within this function. Open
return -1;
Avoid too many return
statements within this function. Open
return -1;
Avoid too many return
statements within this function. Open
return 1;
Avoid too many return
statements within this function. Open
return 1;
Avoid too many return
statements within this function. Open
return 0;
Avoid too many return
statements within this function. Open
return -1;
Function create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
create<T = unknown>(name: string, initialValue?: T): FASTContext<T> {
const Interface = function (
target: Constructable<Node>,
property: string,
index: number
- 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"