hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

File XmlParser.py has 542 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# This file is used to parse a xml file of .PKG file
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/XmlParser.py - About 1 day to fix

    Consider simplifying this complex logical expression.
    Open

                        if LA35 == 63:
                            alt35 = 5
                        elif LA35 == 29 or LA35 == 30 or LA35 == 31 or LA35 == 32 or LA35 == 33 or LA35 == 34 or LA35 == 35 or LA35 == 36 or LA35 == 37 or LA35 == 38 or LA35 == 39 or LA35 == 40 or LA35 == 41 or LA35 == 42 or LA35 == 45 or LA35 == 46 or LA35 == 48 or LA35 == 49 or LA35 == 50 or LA35 == 51 or LA35 == 52 or LA35 == 53 or LA35 == 54 or LA35 == 55 or LA35 == 56 or LA35 == 57 or LA35 == 58 or LA35 == 59 or LA35 == 60 or LA35 == 61 or LA35 == 66:
                            alt35 = 3
                        elif LA35 == IDENTIFIER:
    Severity: Critical
    Found in BaseTools/Source/Python/Ecc/CParser.py - About 1 day to fix

      Consider simplifying this complex logical expression.
      Open

                          if LA35 == 63:
                              alt35 = 5
                          elif LA35 == 29 or LA35 == 30 or LA35 == 31 or LA35 == 32 or LA35 == 33 or LA35 == 34 or LA35 == 35 or LA35 == 36 or LA35 == 37 or LA35 == 38 or LA35 == 39 or LA35 == 40 or LA35 == 41 or LA35 == 42 or LA35 == 45 or LA35 == 46 or LA35 == 48 or LA35 == 49 or LA35 == 50 or LA35 == 51 or LA35 == 52 or LA35 == 53 or LA35 == 54 or LA35 == 55 or LA35 == 56 or LA35 == 57 or LA35 == 58 or LA35 == 59 or LA35 == 60 or LA35 == 61 or LA35 == 66:
                              alt35 = 3
                          elif LA35 == IDENTIFIER:
      Severity: Critical
      Found in BaseTools/Source/Python/Eot/CParser.py - About 1 day to fix

        File telnetlib.py has 540 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        r"""TELNET client class.
        
        Based on RFC 854: TELNET Protocol Specification, by J. Postel and
        J. Reynolds
        
        Severity: Major
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/telnetlib.py - About 1 day to fix

          File telnetlib.py has 540 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          r"""TELNET client class.
          
          Based on RFC 854: TELNET Protocol Specification, by J. Postel and
          J. Reynolds
          
          Severity: Major
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/telnetlib.py - About 1 day to fix

            Function InsertSectionItemsIntoDatabase has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
            Open

                def InsertSectionItemsIntoDatabase(self, FileID, Filename, CurrentSection, SectionItemList, ArchList, ThirdList, IfDefList):
                    #
                    # Insert each item data of a section
                    #
                    for Index in range(0, len(ArchList)):
            Severity: Minor
            Found in BaseTools/Source/Python/Common/DscClassObject.py - About 1 day 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 ParsePcdComment has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
            Open

            def ParsePcdComment(CommentList, PcdTypeItem, PcdItemObj):
                CommentInsList = []
                PreUsage = None
                PreHelpText = ''
                BlockFlag = -1
            Severity: Minor
            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 1 day 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 CheckFuncLayoutPrototype has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
            Open

            def CheckFuncLayoutPrototype(FullFileName):
                ErrorMsgList = []
            
                FileID = GetTableID(FullFileName, ErrorMsgList)
                if FileID < 0:
            Severity: Minor
            Found in BaseTools/Source/Python/Ecc/c.py - About 1 day 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 57 (exceeds 5 allowed). Consider refactoring.
            Open

            def main(argv=None):
                import getopt
            
                if argv is None:
                    argv = sys.argv
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/trace.py - About 1 day 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 get_platform has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
            Open

            def get_platform():
                """Return a string that identifies the current platform.
            
                This is used mainly to distinguish platform-specific build directories and
                platform-specific built distributions.  Typically includes the OS name
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/sysconfig.py - About 1 day 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 a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
            Open

                def __new__(cls, value="0", context=None):
                    """Create a decimal point instance.
            
                    >>> Decimal('3.14')              # string input
                    Decimal('3.14')
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/decimal.py - About 1 day 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 57 (exceeds 5 allowed). Consider refactoring.
            Open

            def main(argv=None):
                import getopt
            
                if argv is None:
                    argv = sys.argv
            Severity: Minor
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/trace.py - About 1 day 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 a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
            Open

                def __new__(cls, value="0", context=None):
                    """Create a decimal point instance.
            
                    >>> Decimal('3.14')              # string input
                    Decimal('3.14')
            Severity: Minor
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/decimal.py - About 1 day 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 get_platform has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
            Open

            def get_platform():
                """Return a string that identifies the current platform.
            
                This is used mainly to distinguish platform-specific build directories and
                platform-specific built distributions.  Typically includes the OS name
            Severity: Minor
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/sysconfig.py - About 1 day 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 CommentParsingUnitTest.py has 536 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            ## @file
            # This file contain unit test for CommentParsing
            #
            # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
            #
            Severity: Major
            Found in BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py - About 1 day to fix

              Unparser has 61 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Unparser:
                  """Methods in this class recursively traverse an AST and
                  output source code for the abstract syntax; original formatting
                  is disregarded. """
              
              Severity: Major
              Found in AppPkg/Applications/Python/Python-2.7.2/Demo/parser/unparse.py - About 1 day to fix

                File GenFdsGlobalVariable.py has 534 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                ## @file
                # Global variables for GenFds
                #
                #  Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
                #
                Severity: Major
                Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 1 day to fix

                  Function ReplaceMacro has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def ReplaceMacro(String, MacroDefinitions = None,  SelfReplacement = False, Line = None, FileName = None, Flag = False):
                      LastString = String
                      if MacroDefinitions == None:
                          MacroDefinitions = {}
                      while MacroDefinitions:
                  Severity: Minor
                  Found in BaseTools/Source/Python/UPT/Library/String.py - About 1 day 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 BuildExDataBase has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def BuildExDataBase(Dict):
                      # init Db items
                      InitValueUint64 = Dict['INIT_DB_VALUE_UINT64']
                      DbInitValueUint64 = DbComItemList(8, RawDataList = InitValueUint64)
                      VardefValueUint64 = Dict['VARDEF_DB_VALUE_UINT64']
                  Severity: Minor
                  Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 1 day 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 specifier_qualifier_list has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def specifier_qualifier_list(self, ):
                  
                          specifier_qualifier_list_StartIndex = self.input.index()
                          try:
                              try:
                  Severity: Minor
                  Found in BaseTools/Source/Python/Ecc/CParser.py - About 1 day 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

                  Severity
                  Category
                  Status
                  Source
                  Language