toggle-corp/react-rest-request

View on GitHub
src/RequestClient.tsx

Summary

Maintainability
B
6 hrs
Test Coverage

Function createRequestClient has 249 lines of code (exceeds 100 allowed). Consider refactoring.
Open

export function createRequestClient<Props extends object, Params>(requests: { [key: string]: ClientAttributes<Props, Params>} = {}, consume?: string[]) {
    return (WrappedComponent: React.ComponentType<NewProps<Props, Params>>) => {
        const requestKeys = Object.keys(requests);
        const requestsOnMount = requestKeys.filter(key => requests[key].onMount);
        const requestsNonPersistent = requestKeys.filter(key => !requests[key].isPersistent);
Severity: Major
Found in src/RequestClient.tsx - About 6 hrs to fix

    Sorry, description could not be provided due to the internal error: Error: rule named object-shorthand-properties-first is not found in the metadata. at IssueConverter.contentBody (/usr/src/app/dist/issueConverter.js:48:19) at IssueConverter.convert (/usr/src/app/dist/issueConverter.js:34:28) at MapSubscriber._next (/usr/src/app/node_modules/rxjs/internal/operators/map.js:49:35) at MapSubscriber.Subscriber.next (/usr/src/app/node_modules/rxjs/internal/Subscriber.js:66:18) at Observable._subscribe (/usr/src/app/node_modules/rxjs/internal/util/subscribeToArray.js:5:20) at Observable._trySubscribe (/usr/src/app/node_modules/rxjs/internal/Observable.js:44:25) at Observable.subscribe (/usr/src/app/node_modules/rxjs/internal/Observable.js:30:22) at MapOperator.call (/usr/src/app/node_modules/rxjs/internal/operators/map.js:32:23) at Observable.subscribe (/usr/src/app/node_modules/rxjs/internal/Observable.js:25:31) at CatchOperator.call (/usr/src/app/node_modules/rxjs/internal/operators/catchError.js:32:23)
    Open

    }
    Severity: Minor
    Found in src/RequestClient.tsx by tslint

    TODO found
    Open

                            // TODO: resolve other methods as well
    Severity: Minor
    Found in src/RequestClient.tsx by fixme

    There are no issues that match your filters.

    Category
    Status