Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix data promotion in generic_image reader and satpy.composites.add_bands #2923

Merged
merged 5 commits into from
Oct 14, 2024

Put common asserts to a helper function

c6db95d
Select commit
Loading
Failed to load commit list.
Merged

Fix data promotion in generic_image reader and satpy.composites.add_bands #2923

Put common asserts to a helper function
c6db95d
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) succeeded Oct 10, 2024 in 1m 57s

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) 🔥

View detailed results in CodeScene

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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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

See this annotation in the file changed.

@codescene-delta-analysis 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.