File handlers.py
has 705 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Module contains basic handlers:
* BaseHandler - to be used for custom handlers. For instance - RPC, if you wish.
* ApiHandler - Abstract for API handlers above.
Function qs_filter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def qs_filter(cls, qs, flt, value, process_value=True):
"""
Private method to set WHERE part of query.
If required, Django-style filter is available via qs.filter()
and peewee.DQ - this method provides joins.
- 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 get_queryset
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_queryset(self, paginate=True):
"""
Get queryset for model.
Override this method to change logic.
- 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 qs_order_by
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def qs_order_by(cls, qs, value, process_value=True):
"""
Set ORDER BY part of response.
Fields are passed in a string with commas to separate values.
- 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"