CodeTeam/tcrudge

View on GitHub
tcrudge/handlers.py

Summary

Maintainability
D
1 day
Test Coverage

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.
Severity: Major
Found in tcrudge/handlers.py - About 1 day to fix

    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.
    Severity: Minor
    Found in tcrudge/handlers.py - About 55 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 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.
    
    
    Severity: Minor
    Found in tcrudge/handlers.py - About 45 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 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.
    Severity: Minor
    Found in tcrudge/handlers.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

    There are no issues that match your filters.

    Category
    Status