Track and write measurement time for area #3168
CodeScene PR Check
Quality Gate Failed
Code Health Improved
(3 files improve in Code Health)
Gates Failed
Enforce advisory code health rules
(5 files with Large Method, Complex Method, Excess Number of Function Arguments, Code Duplication)
Gates Passed
3 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| test_atmosphere.py | 2 advisory rules | 9.10 | Suppress |
| simple_image.py | 1 advisory rule | 10.00 → 9.69 | Suppress |
| core.py | 1 advisory rule | 10.00 → 9.69 | Suppress |
| ninjogeotiff.py | 1 advisory rule | 8.65 → 8.61 | Suppress |
| geotiff.py | 1 advisory rule | 8.41 → 8.39 | Suppress |
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| scene.py | 6.96 → 7.26 | Complex Method, Bumpy Road Ahead |
| test_core.py | 9.39 → 10.00 | Code Duplication |
| test_modifiers.py | 9.10 → 9.39 | Excess Number of Function Arguments |
Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
Details
🚩 Declining Code Health (highest to lowest):
- Complex Method geotiff.py: GeoTIFFWriter.save_image
- Code Duplication test_atmosphere.py
- Large Method ninjogeotiff.py: NinJoGeoTIFFWriter.save_image
- Complex Method core.py: _verify_times
- Excess Number of Function Arguments test_atmosphere.py: TestPSPRayleighReflectance.test_rayleigh_corrector
- Excess Number of Function Arguments simple_image.py: PillowWriter.save_image
✅ Improving Code Health:
- Complex Method scene.py: Scene._resampled_scene 🔥
- Bumpy Road Ahead scene.py: Scene._resampled_scene 🔥
- Code Duplication test_core.py
- Excess Number of Function Arguments test_modifiers.py: TestPSPRayleighReflectance.test_rayleigh_corrector
Annotations
Check notice on line 1 in satpy/scene.py
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ No longer an issue: Complex Method
Scene._resampled_scene is no longer above the threshold for cyclomatic complexity. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
Check notice on line 1 in satpy/scene.py
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ No longer an issue: Bumpy Road Ahead
Scene._resampled_scene is no longer above the threshold for logical blocks with deeply nested code. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.
Check warning on line 183 in satpy/writers/ninjogeotiff.py
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ Getting worse: Large Method
NinJoGeoTIFFWriter.save_image increases from 90 to 97 lines of code, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
Check warning on line 256 in satpy/writers/geotiff.py
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ Getting worse: Complex Method
GeoTIFFWriter.save_image already has high cyclomatic complexity, and now it increases in Lines of Code from 139 to 144. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
Check warning on line 85 in satpy/writers/simple_image.py
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Excess Number of Function Arguments
PillowWriter.save_image has 5 arguments, max arguments = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 1 in satpy/tests/compositor_tests/test_core.py
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ No longer an issue: Code Duplication
The module no longer contains too many functions with similar structure
Check warning on line 612 in satpy/composites/core.py
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Complex Method
_verify_times has a cyclomatic complexity of 10, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
Check notice on line 437 in satpy/tests/test_modifiers.py
codescene-delta-analysis / CodeScene Code Health Review (main)
✅ No longer an issue: Excess Number of Function Arguments
TestPSPRayleighReflectance.test_rayleigh_corrector is no longer above the threshold for number of arguments
Check warning on line 235 in satpy/tests/modifier_tests/test_atmosphere.py
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Code Duplication
The module contains 3 functions with similar structure: fake_ir_039_dask_with_time,fake_ir_108_dask_with_time,fake_ir_134_dask_with_time. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Check warning on line 135 in satpy/tests/modifier_tests/test_atmosphere.py
codescene-delta-analysis / CodeScene Code Health Review (main)
❌ New issue: Excess Number of Function Arguments
TestPSPRayleighReflectance.test_rayleigh_corrector has 9 arguments, max arguments = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.