Function import_key
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def import_key(keyserver: str, keyid: str):
"""
Attempts to import a key from the keyserver.
:param keyserver: The keyserver to import from.
:param keyid: The Key ID to import.
- 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 synch_keys
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def synch_keys():
print("Synching keys...")
# We only synch once per bootup, because when a new key is added to any server, it's automatically distributed.
# This ensures servers don't lag behind the rest of the pool.
# Get the latest sync time.
- 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 _broadcast_add
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _broadcast_add(key: db.Key):
# Load the keyservers from the config file.
keyservers = cfg.cfg.config.keyservers_synch
for server in keyservers:
assert isinstance(server, 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
Avoid too many return
statements within this function. Open
return -1
Avoid too many return
statements within this function. Open
return -4
Avoid too many return
statements within this function. Open
return -3
Avoid too many return
statements within this function. Open
return 0