Showing 45 of 52 total issues
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
- Read upRead up
- Create a ticketCreate a ticket
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 switch
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def switch(
*params, debug: bool = True, on_widgets: List[str] = [], targets: List[bool] = []
) -> Any:
r"""Decorator to switch the state of input boolean parameters on class widgets or the class itself.
- Read upRead up
- Create a ticketCreate a ticket
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 main
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main() -> None:
"""Launch the process."""
# parse arguments
parser.parse_args()
- Create a ticketCreate a ticket
Function __init__
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
methods: Union[str, List[str]] = "ALL",
gee: bool = True,
map_: Optional[sm.SepalMap] = None,
- Read upRead up
- Create a ticketCreate a ticket
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 _get_items
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _get_items(self) -> List[v.ListItem]:
"""Create the list of items inside the folder.
Returns:
list of items inside the selected folder
- Read upRead up
- Create a ticketCreate a ticket
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 get_children
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_children(
self,
widget: Optional[v.VuetifyWidget] = None,
klass: Optional[Type[v.VuetifyWidget]] = None,
attr: str = "",
- Read upRead up
- Create a ticketCreate a ticket
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 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
basemaps: List[str] = [],
dc: bool = False,
vinspector: bool = False,
- Create a ticketCreate a ticket
Function get_xyz_dict
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_xyz_dict(
free_only: bool = True,
_collection: Optional[dict] = None,
_output: Optional[dict] = None,
) -> dict:
- Read upRead up
- Create a ticketCreate a ticket
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 catch_errors
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def catch_errors(alert: Optional[v.Alert] = None, debug: Optional[bool] = None) -> Any:
"""Decorator to execute try/except sentence and catch errors in the alert message.
If debug is True then the error is raised anyway.
- Read upRead up
- Create a ticketCreate a ticket
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 delete_assets
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def delete_assets(asset_id: str, dry_run: bool = True) -> None:
"""Delete the selected asset and all its content.
This method will delete all the files and folders existing in an asset folder. By default a dry run will be launched and if you are satisfyed with the displayed names, change the ``dry_run`` variable to ``False``. No other warnng will be displayed.
- Read upRead up
- Create a ticketCreate a ticket
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 geojson_to_ee
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def geojson_to_ee(
geo_json: dict, geodesic: bool = False, encoding: str = "utf-8"
) -> ee.FeatureCollection:
"""Transform a geojson object into a featureCollection or a Geometry.
- Read upRead up
- Create a ticketCreate a ticket
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 main
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main() -> None:
"""Launch the venv creation process."""
# read arguments (there should be none)
parser.parse_args()
- Create a ticketCreate a ticket
Function read_data
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def read_data(self, **kwargs) -> None:
"""Read the data when the map is clicked with the vinspector activated.
Args:
kwargs: any arguments from the map interaction
- Read upRead up
- Create a ticketCreate a ticket
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 sanitize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def sanitize(cls, d: Union[dict, list]) -> dict:
"""Identify numbered dictionaries embedded in the dict and transform them into lists.
This function is an helper to prevent deprecation after the introduction of pontoon for translation.
The user is now force to use keys even for numbered lists. SimpleNamespace doesn't support integer indexing
- Read upRead up
- Create a ticketCreate a ticket
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 loading_button
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def loading_button(
alert: Optional[v.Alert] = None,
button: Optional[v.Btn] = None,
debug: Optional[bool] = None,
) -> Any:
- Read upRead up
- Create a ticketCreate a ticket
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 key_use
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def key_use(self, folder: Path, name: str) -> List[str]:
"""Parse all the files in the folder and check if keys are all used at least once.
Return the unused key names.
- Read upRead up
- Create a ticketCreate a ticket
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 search_status
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def search_status(d: dict) -> List[Dict[str, bool]]:
"""Get the status of a specific subscription.
Args:
d: dictionary of subscription object
- Read upRead up
- Create a ticketCreate a ticket
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 _toggle_btns
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _toggle_btns(self, change: dict) -> None:
"""Toggle the status of the btns."""
if not change["new"]:
self.v_model = 1
[self._turn_btn(btn_id, False) for btn_id in BTNS.keys()]
- Read upRead up
- Create a ticketCreate a ticket
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 read_data
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def read_data(self, **kwargs) -> None:
"""Read the data when the map is clicked with the vinspector activated.
Args:
kwargs: any arguments from the map interaction
- Create a ticketCreate a ticket
Function __init__
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
extensions: List[str] = [],
folder: Union[str, Path] = Path.home(),
label: str = ms.widgets.fileinput.label,
- Create a ticketCreate a ticket