cloudfoundry/stratos

View on GitHub
src/frontend/packages/cloud-foundry/src/store/reducers/cf-users.reducer.ts

Summary

Maintainability
A
0 mins
Test Coverage

Function updateUserMissingRoles has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Wontfix

function updateUserMissingRoles(users: IRequestEntityTypeState<APIResource<CfUser>>, action: APISuccessOrFailedAction<NormalizedResponse>) {
  // At this point in the flow the request flow (APISuccessOrFailedAction), the users may or may not be in the store yet
  // (via WrapperRequestActionSuccess). Therefore in order to avoid partial entities we need to stick the whole user set into the store
  // including `missingRoles`.
  const usersInResponse: IRequestEntityTypeState<APIResource<CfUser>> = action.response.entities[cfUserEntityType];

    Function newEntityState has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Wontfix

    function newEntityState<T = StateEntity>(state: StateEntities<T>, action: ChangeCfUserRole, add: boolean): StateEntities<T> {
      const apiResource: APIResource<T> = state[action.guid];
      if (!apiResource) {
        return state;
      }

      Function updatePermission has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Wontfix

        user: CfUser,
        entityGuid: string,
        isSpace: boolean,
        permissionType: OrgUserRoleNames | SpaceUserRoleNames,
        add = false) {

        There are no issues that match your filters.

        Category
        Status