the-allanc/lamium

View on GitHub

Showing 4 of 6 total issues

Function format_url has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def format_url(self, url, positionals, named):
        if not (named or positionals):
            e = 'requires at least one positional argument or keyword parameter'
            raise ValueError(e)

Severity: Minor
Found in lamium.py - About 1 hr 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 _merge_request_params has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def _merge_request_params(self, method, *args, **kwargs):

        # If we're given positional arguments, then try and infer the context
        # of what positional arguments should mean.
        if args:
Severity: Minor
Found in lamium.py - About 1 hr 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 send_request has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def send_request(self, method, data=None, notfound=None, response=False, **kwargs):
Severity: Minor
Found in lamium.py - About 35 mins to fix

    Function __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(cls, name, bases, nmspec):
            super(LamiumResourceMeta, cls).__init__(name, bases, nmspec)
            compiled = {}
    
            for verb in cls.__verbs__:
    Severity: Minor
    Found in lamium.py - About 35 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

    Severity
    Category
    Status
    Source
    Language