hackedteam/vector-edk

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

Summary

Maintainability
F
3 days
Test Coverage

File codecs.py has 754 lines of code (exceeds 250 allowed). Consider refactoring.
Open

""" codecs -- Python Codec Registry, API and helpers.


Written by Marc-Andre Lemburg (mal@lemburg.com).
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/codecs.py - About 1 day to fix

    Function readline has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

        def readline(self, size=None, keepends=True):
    
            """ Read one line from the input stream and return the
                decoded data.
    
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/codecs.py - About 6 hrs 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 read has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        def read(self, size=-1, chars=-1, firstline=False):
    
            """ Decodes data from the stream self.stream and returns the
                resulting object.
    
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/codecs.py - About 4 hrs 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 open has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def open(filename, mode='rb', encoding=None, errors='strict', buffering=1):
    
        """ Open an encoded file using the given mode and return
            a wrapped version providing transparent encoding/decoding.
    
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/codecs.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 __new__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __new__(cls, encode, decode, streamreader=None, streamwriter=None,
    Severity: Major
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/codecs.py - About 50 mins to fix

      Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, stream, encode, decode, Reader, Writer,
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/codecs.py - About 45 mins to fix

        Function open has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def open(filename, mode='rb', encoding=None, errors='strict', buffering=1):
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/codecs.py - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status