client/app/bundles/comments/reducers/commentsReducer.js
Function commentsReducer
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function commentsReducer($$state = $$initialState, action = null) {
const { type, comment, comments, error, locale } = action;
switch (type) {
case actionTypes.FETCH_COMMENTS_SUCCESS: {
Avoid too many return
statements within this function. Open
Open
return $$state;
Avoid too many return
statements within this function. Open
Open
return $$state.merge({
locale,
});
Avoid too many return
statements within this function. Open
Open
return $$state.merge({
isSaving: true,
});
Avoid too many return
statements within this function. Open
Open
return $$state.merge({
submitCommentError: error,
isSaving: false,
});
Avoid too many return
statements within this function. Open
Open
return $$state.merge({
isFetching: true,
});