Showing 21 of 35 total issues
Function terminate_process
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def terminate_process(
script_path: str,
termination_timeout: Optional[int] = None,
) -> list[int]:
"""Terminate all processes that have the given script as their
- 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
File text.py
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Functions used for text manipulation/processing.
Implements: `get_random_string`, `pad_string`, `is_date_string`,
`is_rfc3339_datetime_string`, `insert_replacements`, `simplify_string_characters`,
`replace_consecutive_characters`, `RandomLabelGenerator`"""
File em27.py
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Functions for interacting with EM27 interferograms.
Implements: `detect_corrupt_opus_files`, `load_proffast2_result`.
This requires you to install this utils library with the optional `em27` dependency:
OpusHTTPInterface
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class OpusHTTPInterface:
"""Interface to the OPUS HTTP interface.
It uses the socket library, because the HTTP interface of OPUS does not
reuturn valid HTTP/1 or HTTP/2 headers. It opens and closes a new socket
Function read
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def read(
filepath: str,
measurement_timestamp_mode: Literal["start", "end"] = "start",
interferogram_mode: Literal["skip", "validate", "read"] = "read",
read_all_channels: bool = True,
- 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
File timing.py
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Functions used for timing or time calculations.
Implements: `date_range`, `ensure_section_duration`, `set_alarm`,
`clear_alarm`, `wait_for_condition`, `ExponentialBackoff`"""
Function read_last_n_lines
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def read_last_n_lines(
file_path: str,
n: int,
ignore_trailing_whitespace: bool = False,
) -> list[str]:
- 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 parse_timezone_string
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def parse_timezone_string(
timezone_string: str,
dt: Optional[datetime.datetime] = None,
) -> float:
"""Parse a timezone string and return the offset in hours.
- 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 some_macro_is_running
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def some_macro_is_running() -> bool:
"""Check if any macro is currently running.
In theory, we could also check whether the correct macro is running using
`READ_PARAMETER MPT` and `READ_PARAMETER MFN`. However, these variables do
- 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 read_opus_block
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def read_opus_block(
f: io.BufferedReader,
opus_directory_entry: types.OpusDirectoryEntry,
expected_block_type: type[T],
) -> T:
- 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 merge_dicts
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def merge_dicts(old_object: Any, new_object: Any) -> Any:
"""
For a given dict, update it recursively from a new dict.
It will not add any properties and assert that the types
remain the same (or null). null->int or int->null is possible
- 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 read_interferogram
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def read_interferogram(
f: io.BufferedReader,
channel_parameters: list[types.OpusChannelParameters],
ifg_opus_dirs: list[types.OpusDirectoryEntry],
read_all_channels: bool = True,
- 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 detect_corrupt_opus_files
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def detect_corrupt_opus_files(
ifg_directory: str,
silent: bool = True,
fortran_compiler: Literal["gfortran", "gfortran-9"] = "gfortran",
force_recompile: bool = False,
- 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 sleep
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def sleep(self, max_sleep_time: Optional[float] = None) -> float:
"""Wait and increase the wait time to the next bucket.
Args:
max_sleep_time: The maximum time to sleep. If None, no maximum is set.
- 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 list_directory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def list_directory(
Function request_gitlab_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def request_gitlab_file(
Function add_subplot
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_subplot(
Function render_directory_tree
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_directory_tree(
Function request_github_file
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def request_github_file(
Function parse_iso_8601_datetime
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_iso_8601_datetime(s: str) -> datetime.datetime:
"""Parse a datetime string from various formats and return a datetime object.
ISO 8601 supports time zones as `<time>Z`, `<time>±hh:mm`, `<time>±hhmm` and
`<time>±hh`. However, only the second format is supported by `datetime.datetime.fromisoformat()`
- 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"