File TestInject.ts
has 270 lines of code (exceeds 250 allowed). Consider refactoring.
import { expect } from 'chai';
import { spy, stub } from 'sinon';
import { BaseOptions, Container, Contract } from '../../src/Container.js';
import { BaseError } from '../../src/error/BaseError.js';
Function getInject
has a Cognitive Complexity of 8 (exceeds 6 allowed). Consider refactoring.
export function getInject(target: any): Array<Dependency> {
if (Reflect.has(target, injectionSymbol)) {
const existing = Reflect.get(target, injectionSymbol);
if (Array.isArray(existing)) {
return existing;
Function getFields
has a Cognitive Complexity of 8 (exceeds 6 allowed). Consider refactoring.
export function getFields(target: object): Array<Binding> {
if (Reflect.has(target, fieldSymbol)) {
const existing = Reflect.get(target, fieldSymbol);
if (Array.isArray(existing)) {
Function create
has a Cognitive Complexity of 7 (exceeds 6 allowed). Consider refactoring.
public async create<TReturn, TOptions extends BaseOptions>(
contract: Contract<TReturn, TOptions>,
options: PartialOptions<TOptions> = {},
...args: ExtraArgs
): Promise<TReturn> {