Showing 10 of 19 total issues
Function resolve_board
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def resolve_board(
product_code: Optional[str] = None, online_id: Optional[OnlineId] = None, serial_number: str = ""
) -> Board:
"""Resolves a board object from the platform database.
- 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 _find_files
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _find_files(filename: str, directory: Path, filters: Optional[List[Callable]] = None) -> List[Path]:
"""Recursively find files by name under a given directory.
This function automatically applies rules from .mbedignore files found during traversal.
- 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 configure
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def configure(
Function flash_binary
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def flash_binary(
Function _read_details_txt
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _read_details_txt(file_contents: str) -> dict:
"""Parse the contents of a daplink-compatible device's details.txt.
Args:
file_contents: The contents of the details.txt file.
- 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 prepare
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def prepare(
input_data: dict, source_name: Optional[str] = None, target_filters: Optional[Iterable[str]] = None
) -> dict:
"""Prepare a config source for entry into the Config object.
- 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 _extract_config_settings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _extract_config_settings(namespace: str, config_data: dict) -> List[ConfigSetting]:
settings = []
for name, item in config_data.items():
logger.debug("Extracting config setting from '%s': '%s'='%s'", namespace, name, item)
if isinstance(item, dict):
- 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 _extract_overrides
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _extract_overrides(namespace: str, override_data: dict) -> List[Override]:
overrides = []
for name, value in override_data.items():
try:
override_namespace, override_name = name.split(".")
- 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 flatten_nested
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def flatten_nested(input_iter: Iterable) -> List:
"""Flatten a nested Iterable with arbitrary levels of nesting.
If the input is an iterator then this function will exhaust it.
- 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 _load_raw_targets_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _load_raw_targets_data(program: MbedProgram) -> Any:
targets_data = decode_json_file(program.mbed_os.targets_json_file)
if program.files.custom_targets_json.exists():
custom_targets_data = decode_json_file(program.files.custom_targets_json)
for custom_target in custom_targets_data:
- 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"