Showing 42 of 42 total issues
Function translate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def translate(self, sig):
if sig[2] == 32:
return wrap("revoke")
elif sig[2] == 24:
return wrap("subsig")
- 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
Function import_from_dump
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def import_from_dump(file):
"""Import from an SKS dump."""
# First, load a new GPG instance.
gpg = GPG(gnupghome="/tmp/skier-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 from_keyinfo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def from_keyinfo(cls, obj):
k = Key()
for uid in obj.uid:
k.uid.append(uid)
- 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 search
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def search():
if 'keyid' in request.args:
page = request.args.get("page", 1)
try:
page = int(page)
- 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 _discovery
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _discovery(search_str: str) -> None:
"""
Begin a discovery for new keys in a search.
:param search_str: The string to search for.
:return: None.
- 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 wrap("sig-2")
Avoid too many return
statements within this function. Open
return KeyInfo(uid=uid, keyid=keyid, fingerprint=fingerprint, length=length, algo=algo,
Avoid too many return
statements within this function. Open
return -4
Avoid too many return
statements within this function. Open
return "Invalid request", 400
Avoid too many return
statements within this function. Open
return -3
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return -1
Avoid too many return
statements within this function. Open
return json.dumps({"code": 5, "err": "Key exists and unchanged"}), 400, {"Content-Type": "application/json"}
Avoid too many return
statements within this function. Open
return wrap("sig-1")
Avoid too many return
statements within this function. Open
return redirect(url_for("frontend.getkeyinfo", key=keyinfo.shortid, added=True)), 302
Avoid too many return
statements within this function. Open
return ""
Avoid too many return
statements within this function. Open
return wrap("sig")
Avoid too many return
statements within this function. Open
return json.dumps({"code": 0, "err": ""}), 200, {"Content-Type": "application/json"}
Avoid too many return
statements within this function. Open
return wrap("sig??")