cloudfoundry-incubator/stratos

View on GitHub
src/frontend/packages/store/src/reducers/current-user-roles-reducer/user-favorites-groups.reducer.ts

Summary

Maintainability
A
2 hrs
Test Coverage

Function userFavoriteGroupsReducer has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function userFavoriteGroupsReducer(
  state: IUserFavoritesGroupsState = getDefaultFavoriteGroupsState(),
  action: Action
): IUserFavoritesGroupsState {
  switch (action.type) {

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

    function removeFavoriteFromGroup(state: IUserFavoritesGroups, action: RemoveUserFavoriteSuccessAction): IUserFavoritesGroups {
      const { favorite } = action;
      const endpointGuid = getEndpointIDFromFavorite(favorite);
      const userGroup = state[endpointGuid] || getDefaultFavoriteGroup();
      // Favorite will not have and entityId if it is for an endpoint

      There are no issues that match your filters.

      Category
      Status