Add new bucket utilities #68
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: +0.03 (7.84 -> 7.87)
- Declining Code Health: 34 findings(s) 🚩
- Improving Code Health: 21 findings(s) ✅
Details
🚩 Declining Code Health (highest to lowest):
- Large Method pmw.py: get_rgb_composites_receipts
- Low Cohesion pmw.py
- Complex Method dataset.py: _get_scan_modes_datasets_and_closers
- Large Method dataset.py: open_dataset
- Overall Code Complexity coordinates.py
- Code Duplication granule.py
- Code Duplication retrieval_1b_c_pmw.py
- Overall Code Complexity retrieval_1b_c_pmw.py
- Overall Code Complexity collocation.py
- Deep, Nested Complexity pmw.py: find_polarization_pairs
- Overall Code Complexity plot.py
- Large Method plot.py: plot_map
- Large Method plot.py: plot_image
- Large Method granule.py: open_granule_datatree
- Large Method granule.py: open_granule_dataset
- Large Method plot.py: add_map_inset
- Complex Method dataset.py: open_datatree
- Complex Method collocation.py: _expand_with_scan_mode
- Complex Method cross_section.py: plot_cross_section
- Excess Number of Function Arguments datatree.py: open_raw_datatree
- Complex Method retrieval_1b_c_pmw.py: _np_pesca_classification
- Excess Number of Function Arguments retrieval_1b_c_pmw.py: _np_pesca_classification
- Missing Arguments Abstractions collocation.py
- Complex Method pmw.py: find_polarization_pairs
- Complex Conditional pmw.py: find_polarization_pairs
- Complex Conditional facetgrid.py: CustomFacetGrid.map_to_axes
- Excess Number of Function Arguments quicklooks.py: create_quicklooks_datasets
- Complex Method cross_section.py: _get_x_axis_options
- Bumpy Road Ahead cf.py: apply_cf_decoding
- Bumpy Road Ahead cross_section.py: _get_x_axis_options
- Excess Number of Function Arguments xarray.py: _handle_unstack_non_dim_coords
- Excess Number of Function Arguments xarray.py: unstack_datarray_dimension
- Excess Number of Function Arguments xarray.py: unstack_dataset_dimension
- Excess Number of Function Arguments xarray.py: unstack_dimension
✅ Improving Code Health:
- Code Duplication manipulations.py
- Overall Code Complexity checks.py
- Lines of Code in a Single File retrieval_2a_radar.py
- Code Duplication test_dimensions.py
- Code Duplication test_manipulations.py
- Lines of Code in a Single File test_plot.py
- Overall Code Complexity xarray.py
- Lines of Code in a Single File plot.py
- Large Method retrieval_1b_radar.py: open_dataset_1b_ka_fs
- Number of Functions in a Single Module test_plot.py
- Complex Method facetgrid.py: CustomFacetGrid.map_dataarray
- Complex Method plot.py: _get_orientation_location
- Bumpy Road Ahead plot.py: _get_orientation_location
- Excess Number of Function Arguments dataset.py: _open_valid_granules
- Excess Number of Function Arguments granule.py: _open_granule
- Excess Number of Function Arguments granule.py: open_granule
- Excess Number of Function Arguments plots.py: _plot_gdf_map
- Excess Number of Function Arguments plot.py: get_inset_bounds
- Overall Code Complexity dataset.py
- Missing Arguments Abstractions dataset.py
- Code Duplication test_xarray.py
Annotations
Check notice on line 1 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Lines of Code in a Single File
The lines of code decreases from 1112 to 1054, 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 493 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
_get_orientation_location 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 800 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ New issue: Complex Method
plot_xr_imshow 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 warning on line 1152 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Large Method
plot_map increases from 93 to 103 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 1034 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Large Method
plot_image increases from 79 to 84 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 1532 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Large Method
add_map_inset increases from 75 to 76 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 notice on line 493 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Bumpy Road Ahead
_get_orientation_location 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 1 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Overall Code Complexity
This module has a mean cyclomatic complexity of 4.03 across 40 functions. The mean complexity threshold is 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.
Check notice on line 1 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Missing Arguments Abstractions
The average number of function arguments increases from 4.44 to 4.93, threshold = 4.00. The functions in this file have too many arguments, indicating a lack of encapsulation or too many responsibilities in the same functions. Avoid adding more.
Check notice on line 800 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Excess Number of Function Arguments
plot_xr_imshow increases from 9 to 10 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 868 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Excess Number of Function Arguments
_plot_image increases from 9 to 10 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 939 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Excess Number of Function Arguments
_plot_image_facetgrid increases from 9 to 10 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 1034 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Excess Number of Function Arguments
plot_image increases from 9 to 10 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 1152 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Excess Number of Function Arguments
plot_map increases from 12 to 14 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 1209 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Excess Number of Function Arguments
plot_map_mesh increases from 10 to 12 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 1244 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Excess Number of Function Arguments
plot_map_mesh_centroids increases from 10 to 12 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 1532 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Excess Number of Function Arguments
add_map_inset increases from 5 to 6 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 1440 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Excess Number of Function Arguments
get_inset_bounds is no longer above the threshold for number of arguments. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 452 in gpm/visualization/plot.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ New issue: Excess Number of Function Arguments
initialize_cartopy_plot has 6 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 1 in gpm/accessor/methods.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Lines of Code in a Single File
The lines of code increases from 777 to 852, 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 gpm/accessor/methods.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Number of Functions in a Single Module
The number of functions increases from 100 to 107, threshold = 75. This file contains too many functions. Beyond a certain threshold, more functions lower the code health.
Check notice on line 244 in gpm/accessor/methods.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Excess Number of Function Arguments
GPM_Base_Accessor.collocate increases from 9 to 10 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 633 in gpm/accessor/methods.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Excess Number of Function Arguments
GPM_Base_Accessor.plot_transect_line increases from 8 to 10 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 665 in gpm/accessor/methods.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Excess Number of Function Arguments
GPM_Base_Accessor.plot_swath increases from 8 to 10 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check notice on line 697 in gpm/accessor/methods.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ Getting worse: Excess Number of Function Arguments
GPM_Base_Accessor.plot_swath_lines increases from 9 to 11 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.