Removes unused code in DevTools app extensions/ and framework/ directories#9909
Removes unused code in DevTools app extensions/ and framework/ directories#9909kenzieschmoll wants to merge 11 commits into
extensions/ and framework/ directories#9909Conversation
There was a problem hiding this comment.
Code Review
This pull request enables Dart Code Metrics analysis for the extensions and framework directories by removing them from the exclusion list in analysis_options.yaml. This led to cleaning up unused fields, constants, and adding ignore comments for false positives. Additionally, an assertion-based debug check in HomeScreen was refactored to use if (kDebugMode). Feedback was provided regarding a potential "setState() called after dispose()" exception in HomeScreen due to the asynchronous nature of _debugInitVmServiceCache, along with a suggestion to maintain consistency by updating another assertion to use if (kDebugMode).
| _debugInitVmServiceCache(); | ||
| return true; | ||
| }()); | ||
| if (kDebugMode) _debugInitVmServiceCache(); |
There was a problem hiding this comment.
[CONCERN] Since _debugInitVmServiceCache is an asynchronous method that calls setState, it can potentially lead to a "setState() called after dispose()" exception if the widget is disposed before the async operation completes. Consider adding a mounted check before calling setState inside _debugInitVmServiceCache.
Additionally, for consistency with this change, consider updating the saving side in _connectHelper (around line 256) to use if (kDebugMode) instead of assert.
References
- Prefix every comment with a severity: [MUST-FIX], [CONCERN], [NIT]. (link)
Work towards #9906
Chained on top of #9908