ssube/noicejs

View on GitHub

Showing 6 of 8 total issues

File TestInject.ts has 270 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { expect } from 'chai';
import { spy, stub } from 'sinon';
 
import { BaseOptions, Container, Contract } from '../../src/Container.js';
import { BaseError } from '../../src/error/BaseError.js';
Severity: Minor
Found in test/container/TestInject.ts - About 2 hrs to fix

    Function getInject has a Cognitive Complexity of 8 (exceeds 6 allowed). Consider refactoring.
    Open

    export function getInject(target: any): Array<Dependency> {
    if (Reflect.has(target, injectionSymbol)) {
    const existing = Reflect.get(target, injectionSymbol);
    if (Array.isArray(existing)) {
    return existing;
    Severity: Minor
    Found in src/Inject.ts - About 35 mins to fix

    Function getFields has a Cognitive Complexity of 8 (exceeds 6 allowed). Consider refactoring.
    Open

    export function getFields(target: object): Array<Binding> {
    if (Reflect.has(target, fieldSymbol)) {
    const existing = Reflect.get(target, fieldSymbol);
    // console.log('target has fields', target, existing);
    if (Array.isArray(existing)) {
    Severity: Minor
    Found in src/Field.ts - About 35 mins to fix

    Function create has a Cognitive Complexity of 7 (exceeds 6 allowed). Consider refactoring.
    Open

    public async create<TReturn, TOptions extends BaseOptions>(
    contract: Contract<TReturn, TOptions>,
    options: PartialOptions<TOptions> = {},
    ...args: ExtraArgs
    ): Promise<TReturn> {
    Severity: Minor
    Found in src/Container.ts - About 25 mins to fix

    TODO found
    Open

    // TODO: this shouldn't need any, but TInner is not sufficiently provable and causes a TS error
    Severity: Minor
    Found in src/Container.ts by fixme

    TODO found
    Open

    // TODO: do these options need to extend BaseOptions?
    Severity: Minor
    Found in src/Container.ts by fixme
    Severity
    Category
    Status
    Source
    Language