ajeetchaulagain/react-clean-code-pattern

View on GitHub

Showing 4 of 4 total issues

Function AuthorsSectionComponent has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AuthorsSectionComponent = () => {
  const [searchQuery, setSearchQuery] = useState("");

  const { records: authors, status, error, put } = useContext(DataContext);

Severity: Major
Found in src/components/AuthorsSection/index.js - About 2 hrs to fix

    Function Header has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const Header = (props) => {
      const [isMenuOpen, setIsMenuOpen] = useState(false);
    
      return (
        <div className="wrapper bg-indigo-700">
    Severity: Major
    Found in src/components/Header/index.js - About 2 hrs to fix

      Function useRequestSimple has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const useRequestSimple = (baseUrl, routeName) => {
        const [{ records, status, error }, dispatch] = useReducer(requestReducer, {
          status: REQUEST_STATUS.LOADING,
          records: [],
          error: null,
      Severity: Minor
      Found in src/hooks/useRequest.js - About 1 hr to fix

        Function requestReducer has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const requestReducer = (state, action) => {
          switch (action.type) {
            case GET_ALL_SUCCESS:
              return {
                ...state,
        Severity: Minor
        Found in src/reducers/request.js - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language