Fix/remove constant none checks#3261
Conversation
|
Caution Review failedThe pull request is closed. Summary by CodeRabbit
Note: These changes are internal improvements with no user-facing impact. ✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughThis PR systematically removes unnecessary TypeScript type assertions and non-null assertions across backend tests and frontend components, relying on type inference where feasible and intentionally widening environment variable types to reflect runtime reality. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (9)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The linked issue must be assigned to the PR author. |
|



issue resolved : #3260
This PR removes constant None identity checks from tests where the value is guaranteed to be non-None.
Some tests were asserting is not None on objects created via class constructors (e.g. QuestionDetector()), which always return a valid instance. These assertions were constant expressions that always evaluated to True and were flagged by Sonar as unnecessary.
The fix removes these redundant checks and replaces them with meaningful assertions such as:
type validation using isinstance
attribute existence checks
This improves test clarity, aligns with static analysis rules, and ensures tests validate real behavior rather than guaranteed conditions.