cloudfoundry/stratos

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

Summary

Maintainability
A
0 mins
Test Coverage

Function cfUsersRolesReducer has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Wontfix

export function cfUsersRolesReducer(state: UsersRolesState = defaultState, action: Action): UsersRolesState {
  switch (action.type) {
    case UsersRolesActions.SetUsers:
      const setUsersAction = action as UsersRolesSetUsers;
      const orgGuid = state.newRoles ? state.newRoles.orgGuid : '';

    Function setRole has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Wontfix

      existingState: UsersRolesState,
      orgGuid: string,
      orgName: string,
      spaceGuid: string,
      spaceName: string,

      Function setSpaceRole has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Wontfix

        orgRoles: IUserPermissionInOrg,
        orgGuid: string,
        orgName: string,
        spaceGuid: string,
        spaceName: string,

        Avoid too many return statements within this function.
        Wontfix

          return state;

          Avoid too many return statements within this function.
          Wontfix

                return {
                  ...state,
                  changedRoles: setChangesAction.changes
                };

            Avoid too many return statements within this function.
            Wontfix

                  return {
                    ...state,
                    isRemove: isRemoveAction.isRemove
                  };

              Avoid too many return statements within this function.
              Wontfix

                    return {
                      ...state,
                      isSetByUsername: isSetByUsernameAction.isSetByUsername
                    };

                There are no issues that match your filters.

                Category
                Status