ForestAdmin/forest-express

View on GitHub
src/services/authorization/action-authorization.ts

Summary

Maintainability
C
7 hrs
Test Coverage
A
95%

File action-authorization.ts has 309 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  ForestAdminClient,
} from '@forestadmin/forestadmin-client';
import hashObject from 'object-hash';
import BadRequestError from '../../utils/errors/bad-request-error';
Severity: Minor
Found in src/services/authorization/action-authorization.ts - About 3 hrs to fix

    Function getRoleIdsAllowedToApprove has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      private async getRoleIdsAllowedToApprove(
        recordsCounterParams: RecordsCounterParams,
        customActionName: string,
        collectionName: string,
        filterForCaller: GenericPlainTree,
    Severity: Minor
    Found in src/services/authorization/action-authorization.ts - About 1 hr to fix

      Function doesTriggerCustomActionRequiresApproval has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private async doesTriggerCustomActionRequiresApproval(
          userId: string | number,
          customActionName: string,
          collectionName: string,
          filterForCaller: GenericPlainTree,
      Severity: Minor
      Found in src/services/authorization/action-authorization.ts - About 1 hr to fix

        Function assertCanTriggerCustomAction has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public async assertCanTriggerCustomAction({
            user: { id: userId },
            collectionName,
            customActionName,
            filterForCaller,
        Severity: Minor
        Found in src/services/authorization/action-authorization.ts - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status