Showing 257 of 257 total issues

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

Function _entities has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _entities(self):
        lst = set()
        for ref_data in self.parts.values():
            for ref in ref_data['items']:
                e = self.objects.get(ref, None)
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 help has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def help(prg):
        hlp = "Usage: {} [options+] <pipeline file (yaml)>\n\n"
        for s in config.settings():
            if prg in s.cmdline and not s.deprecated and not s.hidden:
                h = " --{}".format(s.long_name)
Severity: Minor
Found in src/pyff/constants.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 filter_invalids_from_document has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def filter_invalids_from_document(t: ElementTree, base_url, validation_errors) -> ElementTree:
    xsd = schema()
    for e in iter_entities(t):
        if not xsd.validate(e):
            error = xml_error(xsd.error_log, m=base_url)
Severity: Minor
Found in src/pyff/samlmd.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 xslt_transform has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def xslt_transform(t, stylesheet, params=None):
    if not params:
        params = dict()

    if not hasattr(thread_data, 'xslt'):
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 _modify has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _modify(self, entity, modifier):
        def _m(idx, vv):
            getattr(idx.setdefault(vv, EntitySet()), modifier)(entity)

        for hn in DINDEX:
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

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

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

TODO found
Open

    if req.state.get('match', None):  # TODO - allow this to be passed in via normal arguments
Severity: Minor
Found in src/pyff/builtins.py by fixme

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: 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: BUG: Parameter 'occurrence' unfilled
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: to_json seems like the wrong name for this function?
Severity: Minor
Found in src/pyff/pipes.py by fixme

TODO found
Open

            # TODO: Why don't these have space as word separator like the rest of ParserInfo?
Severity: Minor
Found in src/pyff/samlmd.py by fixme

TODO found
Open

            req.store.update(req.t, tid=resource_name)  # TODO maybe this is not the right thing to do anymore
Severity: Minor
Found in src/pyff/builtins.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

    alias: Optional[str] = Field(None, alias='as')  # TODO: Rename to 'name'?
Severity: Minor
Found in src/pyff/resource.py by fixme

TODO found
Open

    # TODO: All timestamps in SAML are supposed to be without offset from UTC - raise exception if it is not?
Severity: Minor
Found in src/pyff/utils.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