Function parse_processor_args
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def parse_processor_args(processor_args):
"""Parse a string containing parameter assignments,
and return the corresponding dictionary.
Isolated keywords are interpreted as `bool` flags, `False` if the keyword
- 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 _prepare_rules
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _prepare_rules(self):
from trac.wiki.api import WikiSystem
if not self._compiled_rules:
helpers = []
handlers = {}
- 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 deeply nested control flow statements. Open
if len(flag) > 1:
keys.append(str(flag[1:]))
values.append(False)
else:
Function link_resolvers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def link_resolvers(self):
if not self._link_resolvers:
from trac.wiki.api import WikiSystem
resolvers = {}
for resolver in WikiSystem(self.env).syntax_providers:
- 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"