Showing 6 of 16 total issues
Function createOrchestratorObserver
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function createOrchestratorObserver<T, R>(
observer: SubscriptionObserver<R>,
orchestrator: Orchestrator<T, R>
): Orchestrator.Observer<R> {
- 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 createOrchestratorObserver
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createOrchestratorObserver<T, R>(
observer: SubscriptionObserver<R>,
orchestrator: Orchestrator<T, R>
): Orchestrator.Observer<R> {
Function reduce
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
reduce<R>(...args: [ReduceFn<T, R>] | [ReduceFn<T, R>, R]): Observable<R> {
return new Observable<R>(async observer => {
let pending = 0;
let completed = false;
let hasError = false;
Function iterate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function iterate<T>(
iterable: Iterable<T | Promise<T>> | AsyncIterable<T | Promise<T>>,
next: (value: T) => any,
error: (err: unknown) => any,
complete: () => any
Function constructor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
constructor(observable: Observable<T>) {
const handleEvent = (event: ObservableEvent<T>) => queueMicrotask(async () => {
const nextFuture = this.pendingFutures.shift();
- 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 iterate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export async function iterate<T>(
iterable: Iterable<T | Promise<T>> | AsyncIterable<T | Promise<T>>,
next: (value: T) => any,
error: (err: unknown) => any,
complete: () => 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"