Showing 257 of 257 total issues
Function select
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def select(self, member, xp=None):
"""
Select a set of metadata elements and return an EntityDescriptor with the result of the select.
:param member: A selector (cf below)
- 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_handler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def search_handler(request: Request) -> Response:
"""
Implements the /api/search endpoint
:param request: the HTTP request with the 'query' request parameter
- 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 b2u
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def b2u(data: Union[str, bytes, Tuple, List, Set]) -> Union[str, bytes, Tuple, List, Set]:
if is_text(data):
return data
elif isinstance(data, six.binary_type):
return data.decode("utf-8")
- 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 main
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def main():
"""
The (new) main entrypoint for the pyffd command.
"""
args = parse_options("pyffd", __doc__)
- 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 _nodecountry
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _nodecountry(req: Plumbing.Request, *opts):
"""
Sets eidas:NodeCountry
:param req: The request
- 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 valid_until_ts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def valid_until_ts(elt, default_ts: int) -> int:
ts = default_ts
valid_until = elt.get("validUntil", None)
if valid_until is not None:
try:
- 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
TODO found Open
# TODO: Investigate this error, which is probably correct:
- Exclude checks
TODO found Open
# TODO: Unused function
- Exclude checks
TODO found Open
) -> Optional[Element]: # TODO: unsure about this return type
- Exclude checks
TODO found Open
# TODO: offset can be None here, if validUntil is not a valid duration or ISO date
- Exclude checks
TODO found Open
# TODO: if validUntil was not present, valid_until will be the string 'None' here - never the literal None
- Exclude checks
TODO found Open
# TODO: move classes to be able to declare callback: Union['Lambda', 'PipelineCallback']
- Exclude checks
TODO found Open
status_code: Optional[str] = None # HTTP status code as string. TODO: change to int
- Exclude checks
TODO found Open
issue_date: Optional[str] = None # TODO: change to datetime?
- Exclude checks
TODO found Open
next_update: Optional[Union[str, datetime]] = None # TODO: consistently use datetime
- Exclude checks
TODO found Open
# TODO: This seems... dangerous. What's the need for this?
- Exclude checks
TODO found Open
# TODO - sometimes the client sends > 1 accept header value with ','.
- Exclude checks
TODO found Open
# TODO: This seems... dangerous. What's the need for this?
- Exclude checks
TODO found Open
# TODO: what is the right action here?
- Exclude checks
TODO found Open
# TODO: move classes to make the correct typing work: Iterable[Union[Lambda, PipelineCallback]] = Field([])
- Exclude checks