hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

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

def main():
    host = sys.argv[1]
    try:
        hostaddr = gethostbyname(host)
    except error:
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Demo/sockets/telnet.py - About 7 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 _namespaces has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

def _namespaces(elem, encoding, default_namespace=None):
    # identify namespaces used in this tree

    # maps qnames to *encoded* prefix:local names
    qnames = {None: None}
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/etree/ElementTree.py - About 7 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_https has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

        def open_https(self, url, data=None):
            """Use HTTPS protocol."""

            import httplib
            user_passwd = None
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/urllib.py - About 7 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 parse_makefile has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

def parse_makefile(fn, g=None):
    """Parse a Makefile-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/sysconfig.py - About 7 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 parsesequence has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

    def parsesequence(self, seq):
        """Parse an MH sequence specification into a message list.
        Attempt to mimic mh-sequence(5) as close as possible.
        Also attempt to mimic observed behavior regarding which
        conditions cause which error messages."""
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/mhlib.py - About 7 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 _namespaces has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

def _namespaces(elem, encoding, default_namespace=None):
    # identify namespaces used in this tree

    # maps qnames to *encoded* prefix:local names
    qnames = {None: None}
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/etree/ElementTree.py - About 7 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_https has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

        def open_https(self, url, data=None):
            """Use HTTPS protocol."""

            import httplib
            user_passwd = None
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/urllib.py - About 7 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 parse_makefile has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

def parse_makefile(fn, g=None):
    """Parse a Makefile-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/sysconfig.py - About 7 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 parsesequence has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

    def parsesequence(self, seq):
        """Parse an MH sequence specification into a message list.
        Attempt to mimic mh-sequence(5) as close as possible.
        Also attempt to mimic observed behavior regarding which
        conditions cause which error messages."""
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/mhlib.py - About 7 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

File Expression.py has 482 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# This file is used to parse and evaluate expression in directive or PCD value.
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
Severity: Minor
Found in BaseTools/Source/Python/Common/Expression.py - About 7 hrs to fix

    File webbrowser.py has 481 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #! /usr/bin/env python
    """Interfaces for launching and remotely controlling Web browsers."""
    # Maintained by Georg Brandl.
    
    import os
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/webbrowser.py - About 7 hrs to fix

      File webbrowser.py has 481 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #! /usr/bin/env python
      """Interfaces for launching and remotely controlling Web browsers."""
      # Maintained by Georg Brandl.
      
      import os
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/webbrowser.py - About 7 hrs to fix

        ModuleAutoGen has 53 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class ModuleAutoGen(AutoGen):
            ## The real constructor of ModuleAutoGen
            #
            #  This method is not supposed to be called by users of ModuleAutoGen. It's
            #  only used by factory method __new__() to do real initialization work for an
        Severity: Major
        Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 7 hrs to fix

          File Parser.py has 479 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ## @file
          # This file is used to define common parsing related functions used in parsing
          # Inf/Dsc/Makefile process
          #
          # Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
          Severity: Minor
          Found in BaseTools/Source/Python/Eot/Parser.py - About 7 hrs to fix

            Function GenPackageDatabase has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
            Open

                def GenPackageDatabase(self):
                    for Dec in self.DecDatabase.keys():
                        Package = self.DecDatabase[Dec].Package
            
                        for Arch in self.SupArchList:
            Severity: Minor
            Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py - About 7 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 ParseComment has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
            Open

            def ParseComment (Comment, UsageTokens, TypeTokens, RemoveTokens, ParseVariable):
                #
                # Initialize return values
                #
                Usage = None
            Severity: Minor
            Found in BaseTools/Source/Python/UPT/Library/CommentParsing.py - About 7 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 GetIdentifierList has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
            Open

            def GetIdentifierList():
                IdList = []
            
                for pp in FileProfile.PPDirectiveList:
                    Type = GetIdType(pp.Content)
            Severity: Minor
            Found in BaseTools/Source/Python/Eot/c.py - About 7 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 48 (exceeds 5 allowed). Consider refactoring.
            Open

            def main():
                global verbose, interactive, mac, rmok, nologin
                try:
                    opts, args = getopt.getopt(sys.argv[1:], 'a:bil:mnp:qrs:v')
                except getopt.error, msg:
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/ftpmirror.py - About 7 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 run has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
            Open

                def run(self, leaves):
                    """The main interface with the bottom matcher. The tree is
                    traversed from the bottom using the constructed
                    automaton. Nodes are only checked once as the tree is
                    retraversed. When the automaton fails, we give it one more
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/btm_matcher.py - About 7 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 add_defaults has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
            Open

                def add_defaults(self):
                    """Add all the default files to self.filelist:
                      - README or README.txt
                      - setup.py
                      - test/test*.py

            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