Showing 82 of 91 total issues
Function __call__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, request: Request) -> Response:
"""
:param request: Current request
:type request: :class:`kotti.request.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 move_child_position
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def move_child_position(context, request):
""" Move the child from one position to another.
:param context: "Container" node in which the child changes its position.
:type context: :class:kotti.resources.Node or descendant
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def search(self, match: Optional[str] = "any", **kwargs) -> Query:
""" Search the principal database.
:param match: ``any`` to return all principals matching any search
param, ``all`` to return only principals matching
- 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 register
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def register(context, request):
schema = RegisterSchema().bind(request=request)
form = Form(schema, buttons=(Button("register", _("Register")),))
rendered_form = 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
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function deferred_email_validator
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def deferred_email_validator(node, kw):
def raise_invalid_email(node, value):
raise colander.Invalid(node, _("A user with that email already exists."))
request = kw["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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function blank
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def blank(cls, path, environ=None, base_url=None, headers=None, POST=None, **kw):
Function _translate_titles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _translate_titles(info):
result = []
for d in info:
d = d.copy()
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
Function set_default_view
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set_default_view(self):
"""
:summary: Set the node's default view and redirect to it.
:result: Redirect to the context URL.
:rtype: pyramid.httpexceptions.HTTPFound
- 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
for child in childs:
wf = get_workflow(child)
if wf is not None:
wf.transition_to_state(child, self.request, to_state)
self.flash(_("Your changes have been saved."), "success")
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __call__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, event):
results = []
for (evtype, objtype), handlers in self.items():
if isinstance(event, evtype) and (
objtype is None or isinstance(event.object, objtype)
- 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 set_visibility
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set_visibility(self, show):
""" Do the real work to set the visibility of nodes in the menu. Called
by the show and the hide view.
:result: Redirect response to the referrer of 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
Avoid deeply nested control flow statements. Open
if tran_info not in transitions:
transitions.append(tran_info)
return {
Function _to_fieldstorage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _to_fieldstorage(fp, filename, mimetype, size, **_kwds):
Function render_view
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_view(self, name="", context=None, request=None, secure=True, bare=True):
Function email_set_password
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def email_set_password(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(