hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

File String.py has 404 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# This file is used to define common string related functions used in parsing process
#
# Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
Severity: Minor
Found in BaseTools/Source/Python/Common/String.py - About 5 hrs to fix

    File GenFds.py has 404 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    ## @file
    # generate flash image
    #
    #  Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
    #
    Severity: Minor
    Found in BaseTools/Source/Python/GenFds/GenFds.py - About 5 hrs to fix

      DscBuildData has 42 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class DscBuildData(PlatformBuildClassObject):
          # dict used to convert PCD type in database to string used by build tool
          _PCD_TYPE_STRING_ = {
              MODEL_PCD_FIXED_AT_BUILD        :   "FixedAtBuild",
              MODEL_PCD_PATCHABLE_IN_MODULE   :   "PatchableInModule",
      Severity: Minor
      Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 5 hrs to fix

        Consider simplifying this complex logical expression.
        Open

                            if LA17 == 58:
                                LA17_2 = self.input.LA(2)
        
                                if (self.synpred39()) :
                                    alt17 = 1
        Severity: Critical
        Found in BaseTools/Source/Python/Ecc/CParser.py - About 5 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                              if LA17 == 58:
                                  LA17_2 = self.input.LA(2)
          
                                  if (self.synpred39()) :
                                      alt17 = 1
          Severity: Critical
          Found in BaseTools/Source/Python/Eot/CParser.py - About 5 hrs to fix

            LinuxHelper has 42 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class LinuxHelper:
            
                def __init__(self):
                    import platform
                    self.os_system  = platform.system()
            Severity: Minor
            Found in vector-uefi/fd/tool/chipsec/helper/linux/helper.py - About 5 hrs to fix

              File sysconfig.py has 401 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              """Provide access to Python's configuration information.  The specific
              configuration variables available depend heavily on the platform and
              configuration.  The values may be retrieved using
              get_config_var(name), and the list of variables is available via
              get_config_vars().keys().  Additional convenience functions are also
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/sysconfig.py - About 5 hrs to fix

                File sysconfig.py has 401 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                """Provide access to Python's configuration information.  The specific
                configuration variables available depend heavily on the platform and
                configuration.  The values may be retrieved using
                get_config_var(name), and the list of variables is available via
                get_config_vars().keys().  Additional convenience functions are also
                Severity: Minor
                Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/sysconfig.py - About 5 hrs to fix

                  File util.py has 400 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  """distutils.util
                  
                  Miscellaneous utility functions -- anything that doesn't fit into
                  one of the other *util.py modules.
                  """
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/util.py - About 5 hrs to fix

                    File util.py has 400 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    """distutils.util
                    
                    Miscellaneous utility functions -- anything that doesn't fit into
                    one of the other *util.py modules.
                    """
                    Severity: Minor
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/util.py - About 5 hrs to fix

                      Method Skip has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public void Skip(int num) throws IOException
                          {
                              do
                              {
                                  int lenLimit;
                      Severity: Minor
                      Found in vector-uefi/insyde/7zip/Java/SevenZip/Compression/LZ/BinTree.java - About 5 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 ValidateMS1 has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def ValidateMS1(Module, TopXmlTreeLevel):
                          #
                          # Check Guids -> GuidCName
                          #
                          XmlTreeLevel = TopXmlTreeLevel + ['Guids']
                      Severity: Minor
                      Found in BaseTools/Source/Python/UPT/Xml/XmlParser.py - About 5 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 IsValidPcdDatum has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def IsValidPcdDatum(Type, Value):
                          if Type not in ["UINT8", "UINT16", "UINT32", "UINT64", "VOID*", "BOOLEAN"]:
                              return False, ST.ERR_DECPARSE_PCD_TYPE
                          if Type == "VOID*":
                              if not ((Value.startswith('L"') or Value.startswith('"') and \
                      Severity: Minor
                      Found in BaseTools/Source/Python/UPT/Parser/DecParserMisc.py - About 5 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 InstallModuleContentZipFile has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def InstallModuleContentZipFile(ContentZipFile, FromPath, ModulePath, WorkspaceDir, NewPath, Module, Package, ReadOnly,
                                                      ModuleList):
                          #
                          # Extract other files under current module path in content Zip file but not listed in the description 
                          #
                      Severity: Minor
                      Found in BaseTools/Source/Python/UPT/InstallPkg.py - About 5 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 RWFile has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def RWFile(self, CommentCharacter, KeySplitCharacter, Num):
                              try:
                                  fr = open(self.FileName, 'r')
                                  fw = open(os.path.normpath(os.path.join(self.WorkSpace, 'Conf\\targetnew.txt')), 'w')
                      
                      Severity: Minor
                      Found in BaseTools/Source/Python/TargetTool/TargetTool.py - About 5 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 CheckDoxygenCommand has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def CheckDoxygenCommand(FullFileName):
                          ErrorMsgList = []
                      
                          FileID = GetTableID(FullFileName, ErrorMsgList)
                          if FileID < 0:
                      Severity: Minor
                      Found in BaseTools/Source/Python/Ecc/c.py - About 5 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 CheckDeclNoUseCType has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                      Open

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

                      def main():
                          silent = 0
                          verbose = 0
                          if sys.argv[1:]:
                              if sys.argv[1] == '-v':
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/checkpyc.py - About 5 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 load_current_symbols has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def load_current_symbols(self):
                              pc = int(self.ec.getRegisterService().getValue('PC')) & 0xFFFFFFFF
                              if self.in_fv(pc):
                                  debug_infos = []
                                  
                      Severity: Minor
                      Found in ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py - About 5 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 begin has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def begin(self):
                              if self.msg is not None:
                                  # we've already started reading the response
                                  return
                      
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/httplib.py - About 5 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

                      Severity
                      Category
                      Status
                      Source
                      Language