`dcm check-unused-code` false positives
- Lenguaje dominante
- Dart
- Estrellas
- 1.7k
- Forks
- 404
- Merge medio
- 6 d 17 h
- PR fusionados (30 d)
- 18
Descripción
Command: `dcm check-unused-code packages/devtools_app/ --exclude-public-api`
False positives (one common theme I see here is that anything used in `assert` statements is falsely determined "unused"):
```
packages/devtools_app/test/test_infra/utils/extent_delegate_utils.dart (1 issue):
✖ unused field _renderObjectInitialized
at packages/devtools_app/test/test_infra/utils/extent_delegate_utils.dart:19:3
packages/devtools_app/lib/src/extensions/embedded/_controller_web.dart (1 issue):
✖ unused field _initialized
at packages/devtools_app/lib/src/extensions/embedded/_controller_web.dart:81:3
packages/devtools_app/lib/src/framework/home_screen.dart (2 issues):
✖ unused method _debugInitVmServiceCache
at packages/devtools_app/lib/src/framework/home_screen.dart:174:3
packages/devtools_app/lib/src/app.dart (2 issues):
✖ unused class _AlternateCheckedModeBanner
at packages/devtools_app/lib/src/app.dart:616:1
✖ unused constructor _AlternateCheckedModeBanner
at packages/devtools_app/lib/src/app.dart:622:3
packages/devtools_app/lib/src/screens/performance/panes/timeline_events/perfetto/_perfetto_controller_web.dart (1 issue):
✖ unused field _initialized
at packages/devtools_app/lib/src/screens/performance/panes/timeline_events/perfetto/_perfetto_controller_web.dart:162:3
```
I will add more false positives to this list as I find them (working through different directories https://github.com/flutter/devtools/issues/9906).
@incendial
Guía de contribución
Línea de trabajo
Start by running `dcm check-unused-code packages/devtools_app/ --exclude-public-api` and inspect the reported Dart files, including `extent_delegate_utils.dart`, `_controller_web.dart`, `home_screen.dart`, `app.dart`, and `_perfetto_controller_web.dart`. Trace the listed fields, methods, and classes through their assert usages, then verify that genuine uses are no longer reported while actual unused code still is.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- dart
- Área
- tooling
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 52/100