Fix data promotion in generic_image
reader and satpy.composites.add_bands
#2923
CodeScene PR Check
✅ Code Health Quality Gates: OK
Change in average Code Health of affected files: -0.02 (6.20 -> 6.18)
- Declining Code Health: 3 findings(s) 🚩
- Improving Code Health: 1 findings(s) ✅
- Affected Hotspots: 2 files(s) 🔥
Details
🚩 Declining Code Health (highest to lowest):
- Code Duplication test_generic_image.py
- Excess Number of Function Arguments test_generic_image.py: _assert_image_common
- Excess Number of Function Arguments test_generic_image.py: FakeGenericImageFileHandler.init
✅ Improving Code Health:
- Large Method test_generic_image.py: TestGenericImage.setUp
Annotations
Check warning on line 323 in satpy/tests/reader_tests/test_generic_image.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Code Duplication
The module contains 7 functions with similar structure: test_GenericImageFileHandler_nodata_fill_value,test_GenericImageFileHandler_nodata_nan_mask_default,test_image_l,test_image_l_nan and 3 more functions. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Check notice on line 162 in satpy/tests/reader_tests/test_generic_image.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Large Method
TestGenericImage.setUp is no longer above the threshold for lines of code
Check warning on line 178 in satpy/tests/reader_tests/test_generic_image.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
_assert_image_common has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check warning on line 255 in satpy/tests/reader_tests/test_generic_image.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
FakeGenericImageFileHandler.__init__ has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 1 in satpy/composites/__init__.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Lines of Code in a Single File
The lines of code increases from 1276 to 1277, improve code health by reducing it to 600. The number of Lines of Code in a single file. More Lines of Code lowers the code health.
Check notice on line 1 in satpy/tests/test_composites.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Lines of Code in a Single File
The lines of code increases from 1480 to 1484, improve code health by reducing it to 600. The number of Lines of Code in a single file. More Lines of Code lowers the code health.