Static Analysis Tool - Vinuyans/Mega_Chug_Lords-SOEN341_Project_F24 GitHub Wiki
Static Analysis Tools
ESLint
We added an ESM ESLint config file for both our server and client side applications. You can see the outputs as follow:
Client
C:\Users\vinuy\Documents\Concordia\SOEN341\Mega_Chug_Lords-SOEN341_Project_F24\client\src\components\AuthProvider.jsx
58:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components
C:\Users\vinuy\Documents\Concordia\SOEN341\Mega_Chug_Lords-SOEN341_Project_F24\client\src\components\student\RatingModal.jsx
53:13 error 'res' is defined but never used no-unused-vars
C:\Users\vinuy\Documents\Concordia\SOEN341\Mega_Chug_Lords-SOEN341_Project_F24\client\src\components\student\StudentAddCourse.jsx
11:5 error 'register' is assigned a value but never used no-unused-vars
12:5 error 'setError' is assigned a value but never used no-unused-vars
14:18 error 'errors' is assigned a value but never used no-unused-vars
38:6 warning React Hook useEffect has a missing dependency: 'user.user_id'. Either include it or remove the dependency array react-hooks/exhaustive-deps
C:\Users\vinuy\Documents\Concordia\SOEN341\Mega_Chug_Lords-SOEN341_Project_F24\client\src\components\student\StudentLogin.jsx
72:12 error `'` can be escaped with `'`, `‘`, `'`, `’` react/no-unescaped-entities
C:\Users\vinuy\Documents\Concordia\SOEN341\Mega_Chug_Lords-SOEN341_Project_F24\client\src\components\student\StudentView.jsx
8:8 error 'RatingModal' is defined but never used no-unused-vars
9:10 error 'Rating' is defined but never used no-unused-vars
44:6 warning React Hook useEffect has missing dependencies: 'courses.length' and 'isInTeam'. Either include them or remove the dependency array. You can also replace multiple useState variables with useReducer if 'setIsInTeam' needs the current value of 'courses.length' react-hooks/exhaustive-deps
C:\Users\vinuy\Documents\Concordia\SOEN341\Mega_Chug_Lords-SOEN341_Project_F24\client\src\components\teacher\TeacherLogin.jsx
21:41 error 'res' is defined but never used no-unused-vars
63:12 error `'` can be escaped with `'`, `‘`, `'`, `’` react/no-unescaped-entities
C:\Users\vinuy\Documents\Concordia\SOEN341\Mega_Chug_Lords-SOEN341_Project_F24\client\src\components\teacher\TeacherView.jsx
9:10 error 'useNavigate' is defined but never used no-unused-vars
17:10 error 'isHovered' is assigned a value but never used no-unused-vars
29:3 error React Hook "useEffect" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return? react-hooks/rules-of-hooks
37:16 error 'error' is defined but never used no-unused-vars
42:6 warning React Hook useEffect has a missing dependency: 'user.user_id'. Either include it or remove the dependency array react-hooks/exhaustive-deps
51:14 error 'error' is defined but never used no-unused-vars
140:14 error 'error' is defined but never used no-unused-vars
C:\Users\vinuy\Documents\Concordia\SOEN341\Mega_Chug_Lords-SOEN341_Project_F24\client\src\pages\Login.jsx
11:9 error 'user' is assigned a value but never used no-unused-vars
✖ 20 problems (16 errors, 4 warnings)
Server
> [email protected] lint
> eslint .
C:\Users\vinuy\Documents\Concordia\SOEN341\Mega_Chug_Lords-SOEN341_Project_F24\server\db\schemas\group.js
12:7 error 'bas' is assigned a value but never used no-unused-vars
C:\Users\vinuy\Documents\Concordia\SOEN341\Mega_Chug_Lords-SOEN341_Project_F24\server\eslint.config.js
3:8 error 'pluginNode' is defined but never used no-unused-vars
C:\Users\vinuy\Documents\Concordia\SOEN341\Mega_Chug_Lords-SOEN341_Project_F24\server\routes\api.js
4:20 error 'db' is defined but never used no-unused-vars
5:8 error 'Course' is defined but never used no-unused-vars
C:\Users\vinuy\Documents\Concordia\SOEN341\Mega_Chug_Lords-SOEN341_Project_F24\server\routes\coursesRouter.js
92:19 error 'Course' is not defined no-undef
✖ 5 problems (5 errors, 0 warnings)
The linter can be run by running npm run lint
at the root of the project
DeepScan
DeepScan.io is a web-based tool designed to help developers analyze their code for potential issues, focusing primarily on JavaScript and TypeScript codebases. It is commonly used to improve code quality, reduce technical debt, and identify issues such as bugs, performance bottlenecks, and maintainability concerns.
The service provides a dashboard overview for the whole repo:
And a breakdown of the errors and where to find them: