12rambau/sepal_ui

View on GitHub
sepal_ui/mapping/sepal_map.py

Summary

Maintainability
D
2 days
Test Coverage

Function zoom_ee_object has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring.
Open

    def zoom_ee_object(self, item: ee.ComputedObject, zoom_out: int = 1) -> Self:
        """Get the proper zoom to the given ee geometry.

        Args:
            item: the geometry to zoom on
Severity: Minor
Found in sepal_ui/mapping/sepal_map.py - About 2 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function __init__ has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def __init__(
        self,
        basemaps: List[str] = [],
        dc: bool = False,
        vinspector: bool = False,
Severity: Minor
Found in sepal_ui/mapping/sepal_map.py - About 1 hr to fix

Function add_colorbar has 11 arguments (exceeds 10 allowed). Consider refactoring.
Open

    def add_colorbar(
Severity: Major
Found in sepal_ui/mapping/sepal_map.py - About 35 mins to fix

Function _on_theme_change has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _on_theme_change(self, _) -> None:
        """Change the url of the basemaps."""
        light = "https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png"
        dark = "https://a.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png"

Severity: Minor
Found in sepal_ui/mapping/sepal_map.py - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

There are no issues that match your filters.

Category
Status