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)
Severity: Minor
Found in src/pyff/store.py - About 25 mins to fix

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
Severity: Minor
Found in src/pyff/api.py - About 25 mins to fix

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")
Severity: Minor
Found in src/pyff/utils.py - About 25 mins to fix

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__)
Severity: Minor
Found in src/pyff/mdq.py - About 25 mins to fix

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
Severity: Minor
Found in src/pyff/builtins.py - About 25 mins to fix

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:
Severity: Minor
Found in src/pyff/utils.py - About 25 mins to fix

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:
Severity: Minor
Found in src/pyff/builtins.py by fixme

TODO found
Open

# TODO: Unused function
Severity: Minor
Found in src/pyff/utils.py by fixme

TODO found
Open

    ) -> Optional[Element]:  # TODO: unsure about this return type
Severity: Minor
Found in src/pyff/pipes.py by fixme

TODO found
Open

        # TODO: offset can be None here, if validUntil is not a valid duration or ISO date
Severity: Minor
Found in src/pyff/builtins.py by fixme

TODO found
Open

            # TODO: if validUntil was not present, valid_until will be the string 'None' here - never the literal None
Severity: Minor
Found in src/pyff/builtins.py by fixme

TODO found
Open

        # TODO: move classes to be able to declare callback: Union['Lambda', 'PipelineCallback']
Severity: Minor
Found in src/pyff/resource.py by fixme

TODO found
Open

    status_code: Optional[str] = None # HTTP status code as string. TODO: change to int
Severity: Minor
Found in src/pyff/resource.py by fixme

TODO found
Open

    issue_date: Optional[str] = None  # TODO: change to datetime?
Severity: Minor
Found in src/pyff/samlmd.py by fixme

TODO found
Open

    next_update: Optional[Union[str, datetime]] = None  # TODO: consistently use datetime
Severity: Minor
Found in src/pyff/samlmd.py by fixme

TODO found
Open

        # TODO: This seems... dangerous. What's the need for this?
Severity: Minor
Found in src/pyff/pipes.py by fixme

TODO found
Open

    # TODO - sometimes the client sends > 1 accept header value with ','.
Severity: Minor
Found in src/pyff/api.py by fixme

TODO found
Open

        # TODO: This seems... dangerous. What's the need for this?
Severity: Minor
Found in src/pyff/pipes.py by fixme

TODO found
Open

                # TODO: what is the right action here?
Severity: Minor
Found in src/pyff/samlmd.py by fixme

TODO found
Open

    # TODO: move classes to make the correct typing work: Iterable[Union[Lambda, PipelineCallback]] = Field([])
Severity: Minor
Found in src/pyff/resource.py by fixme
Severity
Category
Status
Source
Language