feat(panel): highlight SQL in the Log and Profiling grids by detecting the statement shape, not only the DB command category. - #65
Conversation
…g the statement shape, not only the DB command category.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 2355 2358 +3
===========================================
Files 165 165
Lines 8737 8742 +5
===========================================
+ Hits 8737 8742 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (38)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (5)
🧰 Additional context used🪛 PHPMD (2.15.0)tests/Panel/Log/LogCellRendererTest.php[error] Avoid using static access to class '\PHPForge\Debug\Panel\Log\LogCellRenderer' in method 'testBuildRowOptionsMapsWarningAndInfoToTheirVariantClasses'. (undefined) (StaticAccess) [warning] 20-432: The class LogCellRendererTest has 21 public methods. Consider refactoring LogCellRendererTest to keep number of public methods under 10. (undefined) (TooManyPublicMethods) [error] 221-224: Avoid using static access to class '\PHPForge\Debug\Panel\Log\LogCellRenderer' in method 'testRenderMessageCellHighlightsSqlWhenTheMessageIsAStatement'. (undefined) (StaticAccess) tests/Panel/Db/SqlHighlighterTest.php[warning] 20-178: The class SqlHighlighterTest has 16 public methods. Consider refactoring SqlHighlighterTest to keep number of public methods under 10. (undefined) (TooManyPublicMethods) [error] 170-170: Avoid using static access to class '\PHPForge\Debug\Panel\Db\SqlHighlighter' in method 'testIsStatementAcceptsRawSql'. (undefined) (StaticAccess) [error] 176-176: Avoid using static access to class '\PHPForge\Debug\Panel\Db\SqlHighlighter' in method 'testIsStatementRejectsProseBorrowingSqlVerbs'. (undefined) (StaticAccess) tests/Panel/Profile/ProfileCellRendererTest.php[warning] 21-314: The class ProfileCellRendererTest has 18 public methods. Consider refactoring ProfileCellRendererTest to keep number of public methods under 10. (undefined) (TooManyPublicMethods) [error] 189-194: Avoid using static access to class '\PHPForge\Debug\Panel\Profile\ProfileCellRenderer' in method 'testRenderInfoCellHighlightsSqlWhenTheInfoIsAStatement'. (undefined) (StaticAccess) src/Panel/Log/LogCellRenderer.php[error] 25-190: The class LogCellRenderer has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13. (undefined) (CouplingBetweenObjects) [error] 95-95: Avoid using static access to class '\PHPForge\Debug\Panel\Db\SqlHighlighter' in method 'renderMessageCell'. (undefined) (StaticAccess) src/Panel/Profile/ProfileCellRenderer.php[error] 71-71: Avoid using static access to class '\PHPForge\Debug\Panel\Db\SqlHighlighter' in method 'renderInfoCell'. (undefined) (StaticAccess) src/Panel/Timeline/TimelineRenderer.php[error] 25-367: The class TimelineRenderer has a coupling between objects value of 19. Consider to reduce the number of dependencies under 13. (undefined) (CouplingBetweenObjects) src/Panel/PanelRenderer.php[warning] 64-773: The class PanelRenderer has an overall complexity of 58 which is very high. The configured complexity threshold is 50. (undefined) (ExcessiveClassComplexity) [error] 64-773: The class PanelRenderer has a coupling between objects value of 62. Consider to reduce the number of dependencies under 13. (undefined) (CouplingBetweenObjects) 🔇 Additional comments (38)
📝 SummarySummary by CodeRabbit
WalkthroughThe pull request adds SQL statement detection for log and profiling panel rendering. It also expands PHPDoc across panel models, snapshots, renderers, routing views, request diagnostics, events, and timeline APIs. Tests cover SQL classification and highlighted rendering. ChangesSQL detection and rendering
Panel data documentation
Supporting API documentation
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant LogCellRenderer
participant ProfileCellRenderer
participant SqlHighlighter
LogCellRenderer->>SqlHighlighter: classify log message
ProfileCellRenderer->>SqlHighlighter: classify profile info
SqlHighlighter-->>LogCellRenderer: return SQL statement result
SqlHighlighter-->>ProfileCellRenderer: return SQL statement result
LogCellRenderer->>SqlHighlighter: highlight recognized SQL
ProfileCellRenderer->>SqlHighlighter: highlight recognized SQL
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. A rabbit reads the comments bright Comment |
Pull Request