chore: remove dead and unused modules#809
Conversation
|
@pavsoss is attempting to deploy a commit to the Aditya Sharma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Userunknown84 Hey Aditya...this pr removes quite a few dead/duplicate files, so I'd really suggest reviewing the deletion scope carefully before merging I've audited them against active imports, routes, docker entrypoints and runtime paths...and added the reasoning for each deletion in the pr description I do think this cleanup is important since multiple similar implementations currently exist even though only one is active...which can easily lead contributors to debug or modify the wrong code lmk if there's any external/legacy usage i might've missed...I'd be happy to restore anything if needed :) |
|
@pavsoss i see this later carefully and merge it later . |
|
@pavsoss I see the code and the files which changes there all code delete not particular lines. |
|
@Userunknown84 this was a cleanup and the files jo ismein delte hui hain they were duplicated or dead module... meine harr file ka reason bhi likha hai in the pr description |
Userunknown84
left a comment
There was a problem hiding this comment.
label_encoder.pkl,linear_svm_model.pkl,tfidf_vectorizer.pkl mat remove karo and baki files tally kar raha hu .
Description
Fixes #802
This PR removes dead, duplicated, obsolete, and accidentally committed files from the repository.
Because this change deletes files across multiple parts of the project, each removal was audited against the active application paths, imports, Docker entrypoints, package scripts, workflows, and runtime file resolution before deletion.
No actively mounted route or runtime module is intentionally replaced by this PR. The goal is to remove files that are no longer reachable by the current application or are redundant copies of actively maintained implementations.
Removed Files
backend/app.pyRemoved as an obsolete ML API implementation.
The active ML API entrypoint is
backend/api.py.Dockerfile.apiexplicitly starts:A repository-wide reference search found no imports or startup commands using
app.py.The active container and application startup path therefore do not depend on this file.
backend/middleware/fileValidation.jsbackend/middleware/filevalidation.jsbackend/utils/fileValidation.jsRemoved three unused file-validation implementations.
The exported functions from these modules, including
validateCSVUpload,sanitizeCSVCell, andscanWithClamAV, were not referenced by any active production route.The currently mounted bulk prediction route uses:
The removed ClamAV integration was not part of the active upload path. Existing CSV parsing and formula-injection sanitization in the active upload flow remain unchanged.
backend/tests/fileValidation.test.jsRemoved because the test exclusively imported and tested the deleted
backend/middleware/fileValidation.jsmodule.No active production module depended on the tested middleware.
The backend test command was updated only to remove the obsolete test reference/configuration associated with this deleted test.
backend/routes/prediction.route.jsRemoved as an unused prediction router.
The backend explicitly imports and mounts
predictionRoutes.jsfromserver.js.prediction.route.jsis not imported or registered by the application, making it unreachable from the active Express routing path.backend/middleware/validation.middleware.jsbackend/validators/auth.validator.jsbackend/validators/prediction.validator.jsRemoved unused validation middleware and validator modules.
Their module paths and exported symbols were searched across the application, route composition, tests, and workflow configuration. No active imports, requires, or dynamic registrations were found.
These validators were not connected to the currently mounted request-handling flow.
domain_checker.pyRemoved the obsolete root-level domain checker implementation.
The active implementation is
backend/domain_checker.py, which is imported by backend modules includingapi.pyandemail_header_analyzer.py.A function-by-function comparison confirmed that the root implementation contains no unique functionality. It is a strict subset of the backend version:
extract_domainsis identical.check_blacklistis identical.check_domain_ageincludes more robust date parsing and timezone handling.check_threat_intelligence.analyze_domainincludes threat intelligence in the final analysis.No functions or classes exist exclusively in the root version.
Repository-wide searches also found no direct execution of
domain_checker.pythrough scripts, Dockerfiles, workflows, package commands, or documentation.The root file was therefore an obsolete implementation superseded by the actively used backend version.
Root ML model artifacts
Removed:
The active ML API resolves model artifacts from the backend directory using its configured base path.
For
label_encoder.pklandlinear_svm_model.pkl, the root and backend copies have identical SHA-256 hashes.The root
tfidf_vectorizer.pklis an empty0-bytefile, while the active backend artifact contains the actual model data.The root-level copies are not used by the current ML API startup or model-loading path.
frontend/frontend/src/components/Navbar.jsxRemoved an accidental nested frontend duplicate.
The active frontend project root is
frontend/, and the Vite application builds fromfrontend/src/.The nested
frontend/frontend/src/directory is outside the active frontend source tree and is not referenced by the frontend build configuration.backend/utils/utils/banner.jsRemoved an accidental nested utility duplicate.
The backend explicitly imports:
which resolves to
backend/utils/banner.js.The nested
backend/utils/utils/banner.jsfile is not imported anywhere.backend/middleware/rateLimiter.js.bakRemoved an unused backup artifact.
No build script, runtime configuration, package script, or source module references
.bakfiles or this backup path.The active rate limiter implementation remains at
backend/middleware/rateLimiter.js.Accidental and Garbage Files
Removed:
The route files are empty artifacts that appear to have been accidentally created from Python type-hint fragments.
tatuscontains accidental Git command output.None of these files are imported, executed, referenced by package scripts, or included in application manifests.
Validation
The deletion set was audited against
upstream/mainusing:domain_checker.pyimplementations,The existing backend test command fails on both
upstream/mainand this branch due to a preexisting syntax error inbackend/middleware/rateLimiter.js. The failure is unchanged by this PR.The frontend build also encounters a preexisting JSX syntax error in
ManipulationIndex.jsx, unrelated to the removed nestedNavbar.jsx.No new test or build failure attributable to these deletions was identified.
Scope
This PR intentionally does not fix unrelated preexisting syntax or build errors discovered during validation.
The changes are limited to removing confirmed dead, obsolete, duplicated, or accidentally committed files and updating the backend test command to remove the reference to the deleted obsolete test.