hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function TrimAslFile has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def TrimAslFile(Source, Target, IncludePathFile):
    CreateDirectory(os.path.dirname(Target))
    
    SourceDir = os.path.dirname(Source)
    if SourceDir == '':
Severity: Minor
Found in BaseTools/Source/Python/Trim/Trim.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 makedirs has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def makedirs(name, mode=0777):
    """makedirs(path [, mode=0777])

    Super-mkdir; create a leaf directory and all intermediate ones.
    Works like mkdir, except that any intermediate path segment (not
Severity: Minor
Found in AppPkg/Applications/Python/PyMod-2.7.2/Lib/os.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 _getopt_flags has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def _getopt_flags(options):

    """ Convert the option list to a getopt flag string and long opt
        list

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

Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/i18n/pygettext.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 visible has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def visible(self, name):
        if len(name) > maxnamelen: return 0
        if name[-1] == '~': return 0
        if name in skipnames: return 0
        if self._hidden(name): return 0
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/FSProxy.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 _dorequest has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def _dorequest(self, rf, wf):
        rp = pickle.Unpickler(rf)
        try:
            request = rp.load()
        except EOFError:
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/server.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 show has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def show(total, d, prefix):
    if not d: return
    list = []
    sum = 0
    for key in d.keys():
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/dutree.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 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def send(self, data):
        """Send `data' to the server."""
        if self.sock is None:
            if self.auto_open:
                self.connect()
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/httplib.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 getreply has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def getreply(f):
    line = f.readline()
    if not line: return 'EOF'
    print line,
    code = line[:3]
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Demo/sockets/ftp.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 analyze has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def analyze(self):
        # called by ModuleMetaclass analyze()
        self.name = getattr(self, "abbrev", self.__name__)
        src = getattr(self, "struct", None)
        if src is not None:

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

def message(f, delimiter = ''):
    sts = 0
    # Parse RFC822 header
    m = rfc822.Message(f)
    # Write unix header line
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Demo/scripts/mboxconvert.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 expand_args has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def expand_args(args, flist):
    """read names in flist and append to args"""
    expanded = args[:]
    if flist:
        try:
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/compileall.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 subclass_from_type has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def subclass_from_type(cls, t):
        '''
        Given a PyTypeObjectPtr instance wrapping a gdb.Value that's a
        (PyTypeObject*), determine the corresponding subclass of PyObjectPtr
        to use
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, sock, keyfile=None, certfile=None,
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/ssl.py - About 1 hr to fix

    Function expandvars has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def expandvars(path):
        """Expand shell variables of form $var and ${var}.  Unknown variables
        are left unchanged."""
        global _varprog
        if '$' not in path:
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/posixpath.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 __waiting has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/i18n/pygettext.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 wrap_socket has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def wrap_socket(sock, keyfile=None, certfile=None,
    Severity: Major
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/ssl.py - About 1 hr to fix

      Function main has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def main():
      
          # Use lstat() to stat files if it exists, else stat()
          try:
              statfunc = os.lstat
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/byteyears.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 combine has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def combine(fname):
          f = file(fname)
          fi = iter(f)
      
          for line in read(fi, re.compile(r'^Remaining objects:$'), False):

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

          def report_errors(self):
              if not self.bad:
                  self.message("\nNo errors")
                  return
              self.message("\nError Report:")

      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