-
-
Notifications
You must be signed in to change notification settings - Fork 713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: validate that id is number or we throw our our source code #6860
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 2 findings(s) 🚩
@@ -354,6 +355,7 @@ export default class UserAdminController extends Controller { | |||
...getStandardResponses(400, 401, 404), | |||
}, | |||
}), | |||
idNumberMiddleware(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Getting worse: Large Method
UserAdminController.constructor increases from 303 to 306 lines of code, threshold = 70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 3 findings(s) 🚩
@@ -159,6 +160,7 @@ export class SegmentsController extends Controller { | |||
200: createResponseSchema('segmentStrategiesSchema'), | |||
}, | |||
}), | |||
idNumberMiddleware(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Getting worse: Large Method
SegmentsController.constructor increases from 196 to 200 lines of code, threshold = 70
@@ -109,6 +110,7 @@ export default class PatController extends Controller { | |||
...getStandardResponses(401, 403, 404), | |||
}, | |||
}), | |||
idNumberMiddleware(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Getting worse: Large Method
PatController.constructor increases from 75 to 76 lines of code, threshold = 70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The refactoring looks simple enough. Were there tests testing this functionality in the places we changed from the controller level validation to the middleware?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 3 findings(s) 🚩
Previously, we were not validating that the ID was a number, which sometimes resulted in returning our database queries (source code) to the frontend. Now, we have validation middleware.