Showing 5 of 43 total issues
Function merge_list
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def merge_list(config: dict) -> None:
keys = {}
with suppress(AttributeError):
for k in config.keys():
key, is_list = _fix_key(k)
- 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_dict
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def merge_dict(primary_config: dict, secondary_config: dict) -> dict:
for k, v in primary_config.items():
if isinstance(v, dict):
if k in secondary_config and isinstance(secondary_config[k], dict):
merge_dict(primary_config[k], secondary_config[k])
- 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 client
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def client(
Function client
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def client(
app_name, address, label, profile, filter, auth, digest, file, json, verbose
):
"""Interact with Spring Cloud Server via cli."""
client = ConfigClient(
- 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 to_dict
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def to_dict(config: dict) -> dict:
final_config: dict = {}
for k, v in config.items():
tconfig = {}
last_key = k.split(".")[-1:][0]
- 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"