hackedteam/vector-edk

View on GitHub
AppPkg/Applications/Python/Python-2.7.2/Lib/Cookie.py

Summary

Maintainability
D
1 day
Test Coverage

File Cookie.py has 474 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
#

####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/Cookie.py - About 7 hrs to fix

    Function _unquote has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def _unquote(str):
        # If there aren't any doublequotes,
        # then there can't be any special characters.  See RFC 2109.
        if  len(str) < 2:
            return str
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/Cookie.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 __ParseString has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def __ParseString(self, str, patt=_CookiePattern):
            i = 0            # Our starting point
            n = len(str)     # Length of string
            M = None         # current morsel
    
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/Cookie.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 OutputString has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def OutputString(self, attrs=None):
            # Build up our result
            #
            result = []
            RA = result.append
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/Cookie.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 set has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def set(self, key, val, coded_val,
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/Cookie.py - About 45 mins to fix

      There are no issues that match your filters.

      Category
      Status