AlexAegis/loreplotter

View on GitHub
src/app/lore/store/reducers/lore.reducer.ts

Summary

Maintainability
C
1 day
Test Coverage

Function loreReducer has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function loreReducer(state: LoreState = initialLoreState, action: LoreActions): LoreState {
    switch (action.type) {
        // initial load
        case loadLores.type: {
            return { ...state, loading: true };
Severity: Major
Found in src/app/lore/store/reducers/lore.reducer.ts - About 2 hrs to fix

    Avoid too many return statements within this function.
    Open

                return loreAdapter.addOne(payload, { ...state, loading: false });
    Severity: Major
    Found in src/app/lore/store/reducers/lore.reducer.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return loreAdapter.removeOne(action.payload, { ...state, loading: false });
      Severity: Major
      Found in src/app/lore/store/reducers/lore.reducer.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return { ...state, loading: false };
        Severity: Major
        Found in src/app/lore/store/reducers/lore.reducer.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return { ...state, loading: true };
          Severity: Major
          Found in src/app/lore/store/reducers/lore.reducer.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return { ...state, loading: false };
            Severity: Major
            Found in src/app/lore/store/reducers/lore.reducer.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return { ...state, loading: false, selected: payload.id };
              Severity: Major
              Found in src/app/lore/store/reducers/lore.reducer.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return loreAdapter.updateOne({ id: payload.id, changes: payload }, { ...state, loading: false });
                Severity: Major
                Found in src/app/lore/store/reducers/lore.reducer.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return state;
                  Severity: Major
                  Found in src/app/lore/store/reducers/lore.reducer.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return { ...state, loading: false };
                    Severity: Major
                    Found in src/app/lore/store/reducers/lore.reducer.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return { ...state, loading: true };
                      Severity: Major
                      Found in src/app/lore/store/reducers/lore.reducer.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return { ...state, loading: true };
                        Severity: Major
                        Found in src/app/lore/store/reducers/lore.reducer.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return { ...state, loading: false };
                          Severity: Major
                          Found in src/app/lore/store/reducers/lore.reducer.ts - About 30 mins to fix

                            There are no issues that match your filters.

                            Category
                            Status