hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function TrimEdkSources has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def TrimEdkSources(Source, Target):
    if os.path.isdir(Source):
        for CurrentDir, Dirs, Files in os.walk(Source):
            if '.svn' in Dirs:
                Dirs.remove('.svn')
Severity: Minor
Found in BaseTools/Source/Python/Trim/Trim.py - About 2 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 main has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def main():
    try:
        opts, args = getopt.getopt(sys.argv[1:], 'crs:')
    except getopt.error, msg:
        err('Options error: ' + str(msg) + '\n')
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/fixcid.py - About 2 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 getnextfile has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def getnextfile(f):
    while 1:
        line = f.readline()
        if not line: return None
        if startprog.match(line) >= 0:
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/makechangelog.py - About 2 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 __init__ has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, name, data, magic):
        # turn a (key, value) list into a static hash table structure

        # determine table size
        for size, poly in SIZES:

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 main has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def main():
    if sys.argv[1:]:
        year = int(sys.argv[1])
    else:
        year = int(raw_input('In which year were you born? '))
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Demo/scripts/unbirthday.py - About 2 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 sql has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def sql(self):
        fields = []
        keys = []
        self.fields.sort()
        fields = [None]*len(self.fields)
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/msi/msilib.py - About 2 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 test has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def test(args = None):
    import sys, getopt
    from time import time

    if not args:
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xmllib.py - About 2 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 checkextensions has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def checkextensions(unknown, extensions):
    files = []
    modules = []
    edict = {}
    for e in extensions:

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 popen has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def popen(cmd, mode='r', bufsize=None):

    """ Portable popen() interface.
    """
    # Find a working popen implementation preferring win32pipe.popen
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/platform.py - About 2 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 save_string has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

        def save_string(self, obj, pack=struct.pack):
            unicode = obj.isunicode()

            if self.bin:
                if unicode:
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pickle.py - About 2 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 generate_html_documentation has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def generate_html_documentation(self):
        """generate_html_documentation() => html documentation for the server

        Generates HTML documentation for the server using introspection for
        installed functions and instances that do not implement the
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/DocXMLRPCServer.py - About 2 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 getaddress has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def getaddress(self):
        """Parse the next address."""
        self.commentlist = []
        self.gotonext()
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/email/_parseaddr.py - About 2 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 set_param has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def set_param(self, param, value, header='Content-Type', requote=True,
                  charset=None, language=''):
        """Set a parameter in the Content-Type header.

        If the parameter already exists in the header, its value will be
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/email/message.py - About 2 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 _make_iterencode has 22 arguments (exceeds 4 allowed). Consider refactoring.
Open

def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/json/encoder.py - About 2 hrs to fix

    Function _really_load has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def _really_load(self, f, filename, ignore_discard, ignore_expires):
            now = time.time()
    
            magic = f.readline()
            if not re.search(self.magic_re, magic):
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/_MozillaCookieJar.py - About 2 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 _getNSattrs has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def _getNSattrs(self):
            """Return string of namespace attributes from this element and
            ancestors."""
            # XXX This needs to be re-written to walk the ancestors of the
            # context to build up the namespace information from
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/dom/expatbuilder.py - About 2 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 setFeature has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def setFeature(self, name, state):
            if self._parsing:
                raise SAXNotSupportedException("Cannot set features while parsing")
    
            if name == feature_namespaces:
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/sax/expatreader.py - About 2 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 _interpolate_some has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def _interpolate_some(self, option, accum, rest, section, map, depth):
            if depth > MAX_INTERPOLATION_DEPTH:
                raise InterpolationDepthError(option, section, rest)
            while rest:
                p = rest.find("%")
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/ConfigParser.py - About 2 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 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def open(self, name, mode="r", pwd=None):
            """Return file-like object for 'name'."""
            if mode not in ("r", "U", "rU"):
                raise RuntimeError, 'open() requires mode "r", "U", or "rU"'
            if not self.fp:
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/zipfile.py - About 2 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 finalize_unix has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def finalize_unix (self):
    
            if self.install_base is not None or self.install_platbase is not None:
                if ((self.install_lib is None and
                     self.install_purelib is None and

    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