cloudfoundry-incubator/stratos

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

Summary

Maintainability
B
6 hrs
Test Coverage

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

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.
    Open

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

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

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

        Avoid too many return statements within this function.
        Open

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

          Avoid too many return statements within this function.
          Open

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

            Avoid too many return statements within this function.
            Open

              return state;

              Avoid too many return statements within this function.
              Open

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

                There are no issues that match your filters.

                Category
                Status