Showing 51 of 57 total issues
Function convert
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def convert(
Function assert_close
has 5 arguments (exceeds 4 allowed). Consider refactoring. Confirmed
def assert_close(
Function _free_memory
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _free_memory(self, adi_dataset: CDSGroup):
# First we MUST walk through the object tree and detatch data pointers for all variables. We need
# to do this because the group delete will delete everything in the hierarchy, and we don't want to
# delete the data because it's being shared with xarray.
# * Note that we don't attach/detatch for time because we have to copy those values because of numpy datetime64
- Read upRead up
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 validate_all_ascii
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_all_ascii(cls, values: Dict[Any, Any]) -> Dict[str, str]:
for key, value in values.items():
if not isinstance(key, str) or not key.isascii():
raise ValueError(f"'{key}' contains a non-ascii character.")
if isinstance(value, str) and not value.isascii():
- Read upRead up
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 convert_to_adi_format
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def convert_to_adi_format(
self, transform_parameters: Dict[Any, Any]
) -> Dict[str, str]:
transforms: Dict[Any, Any] = {}
"""
- Read upRead up
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 _back_convert_qc_atts
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _back_convert_qc_atts(self, adi_qc_atts: Dict) -> Dict:
"""-------------------------------------------------------------------------------------------------------------
We are converting from exploded ADI format:
bit_1_description = "Value is equal to _FillValue or NaN"
bit_1_assessment = "Bad"
- Read upRead up
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 _set_bounds_transform_parameters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _set_bounds_transform_parameters(
self, variable_name: str, xr_dataset: xr.Dataset, obs_or_coord_group: CDSGroup
):
# Get the bounds variable for each dimension used by our variable. If no bounds variable exists, then skip.
# Bounds variable saves the offset for each data point instead of full value
- Read upRead up
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 _update_xr_attrs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _update_xr_attrs(
self,
variable_name: str,
output_dataset: xr.Dataset,
transformed_dataset: CDSGroup,
- Read upRead up
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_threshold
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _get_threshold(
self,
dataset: xr.Dataset,
variable_name: str,
min_: bool,
- Read upRead up
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 _generate_regex
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _generate_regex(template: str) -> str:
"""Generates a regex pattern which can be used to extract the values substituted
into a template string.
Args:
- Read upRead up
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 _match_inputs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _match_inputs(self, input_keys: List[str]) -> Dict[str, DataReader]:
input_reader_mapping: Dict[str, DataReader] = {}
for input_key in input_keys:
for regex, reader in self.readers.items(): # type: ignore
regex = cast(Pattern[str], regex)
- Read upRead up
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"