shakacode/react-webpack-rails-tutorial

View on GitHub
client/app/bundles/comments/reducers/commentsReducer.js

Summary

Maintainability
B
5 hrs
Test Coverage

Function commentsReducer has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function commentsReducer($$state = $$initialState, action = null) {
  const { type, comment, comments, error, locale } = action;

  switch (type) {
    case actionTypes.FETCH_COMMENTS_SUCCESS: {
Severity: Major
Found in client/app/bundles/comments/reducers/commentsReducer.js - About 2 hrs to fix

    Avoid too many return statements within this function.
    Open

          return $$state;
    Severity: Major
    Found in client/app/bundles/comments/reducers/commentsReducer.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return $$state.merge({
              locale,
            });
      Severity: Major
      Found in client/app/bundles/comments/reducers/commentsReducer.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return $$state.merge({
                isSaving: true,
              });
        Severity: Major
        Found in client/app/bundles/comments/reducers/commentsReducer.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return $$state.merge({
                  submitCommentError: error,
                  isSaving: false,
                });
          Severity: Major
          Found in client/app/bundles/comments/reducers/commentsReducer.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return $$state.merge({
                    isFetching: true,
                  });
            Severity: Major
            Found in client/app/bundles/comments/reducers/commentsReducer.js - About 30 mins to fix

              There are no issues that match your filters.

              Category
              Status