hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

File zipfile.py has 1111 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
Read and write ZIP files.
"""
import struct, os, time, sys, shutil
import binascii, cStringIO, stat
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/zipfile.py - About 2 days to fix

    File zipfile.py has 1111 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """
    Read and write ZIP files.
    """
    import struct, os, time, sys, shutil
    import binascii, cStringIO, stat
    Severity: Major
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/zipfile.py - About 2 days to fix

      File ast.py has 1104 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Python abstract syntax node definitions
      
      This file is automatically generated by Tools/compiler/astgen.py
      """
      from compiler.consts import CO_VARARGS, CO_VARKEYWORDS
      Severity: Major
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/compiler/ast.py - About 2 days to fix

        File ast.py has 1104 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """Python abstract syntax node definitions
        
        This file is automatically generated by Tools/compiler/astgen.py
        """
        from compiler.consts import CO_VARARGS, CO_VARKEYWORDS
        Severity: Major
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/compiler/ast.py - About 2 days to fix

          Function PreprocessConditionalStatement has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring.
          Open

              def PreprocessConditionalStatement(self):
                  # IfList is a stack of if branches with elements of list [Pos, CondSatisfied, BranchDetermined]
                  IfList = []
                  while self.__GetNextToken():
                      if self.__Token == 'DEFINE':
          Severity: Minor
          Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 2 days 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 FvImage.py has 1085 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ## @file
          # Parse FV image
          #
          # Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
          # This program and the accompanying materials
          Severity: Major
          Found in BaseTools/Source/Python/Eot/FvImage.py - About 2 days to fix

            Function AddToBuffer has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring.
            Open

                def AddToBuffer(self, Buffer, BaseAddress, BlockSizeList, ErasePolarity, ImageBinDict, vtfDict = None, MacroDict = {}):
                    Size = self.Size
                    GenFdsGlobalVariable.InfLogger('\nGenerate Region at Offset 0x%X' % self.Offset)
                    GenFdsGlobalVariable.InfLogger("   Region Size = 0x%X" %Size)
                    GenFdsGlobalVariable.SharpCounter = 0
            Severity: Minor
            Found in BaseTools/Source/Python/GenFds/Region.py - About 2 days 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 libpython.py has 1078 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            #!/usr/bin/python
            '''
            From gdb 7 onwards, gdb's build can be configured --with-python, allowing gdb
            to be extended with Python code e.g. for library-specific data visualizations,
            such as for the C++ STL types.  Documentation on this API can be seen at:
            Severity: Major
            Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py - About 2 days to fix

              File pdb.py has 1064 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              #! /usr/bin/env python
              
              """A Python debugger."""
              
              # (See pdb.doc for documentation.)
              Severity: Major
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pdb.py - About 2 days to fix

                File pdb.py has 1064 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                #! /usr/bin/env python
                
                """A Python debugger."""
                
                # (See pdb.doc for documentation.)
                Severity: Major
                Found in vector-uefi/fd/efi/StdLib/lib/python.27/pdb.py - About 2 days to fix

                  File platform.py has 1060 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  #!/usr/bin/env python
                  
                  """ This module tries to retrieve as much platform-identifying data as
                      possible. It makes this information available via function APIs.
                  
                  Severity: Major
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/platform.py - About 2 days to fix

                    File platform.py has 1060 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    #!/usr/bin/env python
                    
                    """ This module tries to retrieve as much platform-identifying data as
                        possible. It makes this information available via function APIs.
                    
                    Severity: Major
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/platform.py - About 2 days to fix

                      Function constant has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def constant(self, ):
                      
                              constant_StartIndex = self.input.index()
                              try:
                                  try:
                      Severity: Minor
                      Found in BaseTools/Source/Python/Ecc/CParser.py - About 2 days 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 constant has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def constant(self, ):
                      
                              constant_StartIndex = self.input.index()
                              try:
                                  try:
                      Severity: Minor
                      Found in BaseTools/Source/Python/Eot/CParser.py - About 2 days 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 asdl_c.py has 1043 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      #! /usr/bin/env python
                      """Generate C code from an ASDL description."""
                      
                      # TO DO
                      # handle fields that have a type but no name
                      Severity: Major
                      Found in AppPkg/Applications/Python/Python-2.7.2/Parser/asdl_c.py - About 2 days to fix

                        Function __EvaluateConditional has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def __EvaluateConditional(self, Name, Line, Op = None, Value = None):
                                
                                FileLineTuple = GetRealFileLine(self.FileName, Line)
                                if Name in InputMacroDict:
                                    MacroValue = InputMacroDict[Name]
                        Severity: Minor
                        Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 2 days 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 msi.py has 1038 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # Python MSI Generator
                        # (C) 2003 Martin v. Loewis
                        # See "FOO" in comments refers to MSDN sections with the title FOO.
                        import msilib, schema, sequence, os, glob, time, re, shutil, zipfile
                        from msilib import Feature, CAB, Directory, Dialog, Binary, add_data
                        Severity: Major
                        Found in AppPkg/Applications/Python/Python-2.7.2/Tools/msi/msi.py - About 2 days to fix

                          File imaplib.py has 1037 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          """IMAP4 client.
                          
                          Based on RFC 2060.
                          
                          Public class:           IMAP4
                          Severity: Major
                          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/imaplib.py - About 2 days to fix

                            File imaplib.py has 1037 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            """IMAP4 client.
                            
                            Based on RFC 2060.
                            
                            Public class:           IMAP4
                            Severity: Major
                            Found in vector-uefi/fd/efi/StdLib/lib/python.27/imaplib.py - About 2 days to fix

                              Function CycleReferenceCheck has a Cognitive Complexity of 127 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def CycleReferenceCheck(self):
                                      #
                                      # Check the cycle between FV and FD image
                                      #
                                      MaxLength = len (self.Profile.FvDict)
                              Severity: Minor
                              Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 2 days 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