fhir-data-pipes
fhir-data-pipes copied to clipboard
Enable a static code analyzer for null-checking and other common issues
We have experimented with some static code analyzers like SonarQube (e.g., in #704, #706, #707) but these are not adequate, especially for catching NullPointerExceptions. Also we have some @Nullable annotations throughout the code but we don't have a robust null-check static code analyzer that can benefit from these annotations. With release 1.0.0 of Jspecify it makes sense to move our null-check annotations to Jspecify and enable a tool like NullAway on our code. This requires Error Prone which will help catching more issues at compile time.
An early experiment shows over 370 ErrorProne/NullAway warnings, so we should probably fix this issue in multiple phases (e.g., by module).
Here are the total ErrorProne/Nullaway/JavaStyleGuide static code analyzer warnings broken down by module (462 total).
------------ Pipelines ------------
Pipelines Common Module
- [x] Implementation code - 85 Warnings
- [ ] Test code - 72 Warnings
Pipelines Batch Module
- [x] Implementation code - 50 Warnings
- [x] Test code - 59 Warnings
Pipelines Controller Module
- [x] Implementation code - 97 Warnings
- [x] Test code - 8 Warnings
------------ Bunsen ------------
Bunsen Core Module
- [x] Implementation code - 33 Warnings
- [x] Test code - 6 Warnings
Bunsen Core R4 Module
- [x] Implementation code - 4 Warnings
- [x] Test code - 2 Warnings
Bunsen Core STU3 Module
- [x] Implementation code - 3 Warnings
- [x] Test code - 0 Warnings
Bunsen Avro Module
- [x] Implementation code - 30 Warnings
- [x] Test code - 13 Warnings
Thanks @ndegwamartin for the breakdown. It would be nice to see how many of the production code warnings are from NullAway.
Thanks @ndegwamartin for the breakdown. It would be nice to see how many of the production code warnings are from NullAway.
Check out the comment here - https://github.com/google/fhir-data-pipes/issues/1474#issuecomment-3357265412
Reopening this until all sub-issues are resolved.