hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function __init__ has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def __init__(self, fp=None, headers=None, outerboundary="",
                 environ=os.environ, keep_blank_values=0, strict_parsing=0):
        """Constructor.  Read multipart/* until last part.

        Arguments, all optional:
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/cgi.py - About 1 hr to fix

    Function write has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def write(self, filename, arcname=None, compress_type=None):
            """Put the bytes from filename into the archive under the name
            arcname."""
            if not self.fp:
                raise RuntimeError(
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/zipfile.py - About 1 hr to fix

      Function display_SPI_Ranges_Access_Permissions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def display_SPI_Ranges_Access_Permissions( self ):
              logger().log( "SPI Flash Region Access Permissions" )
              logger().log( "------------------------------------------------------------" )
              fracc  = self.spi_reg_read( PCH_RCBA_SPI_FRAP )
              logger().log( "FRAP = %08X" % fracc )
      Severity: Minor
      Found in vector-uefi/fd/tool/chipsec/hal/spi.py - About 1 hr to fix

        Function __init__ has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def __init__(self, fp=None, headers=None, outerboundary="",
                         environ=os.environ, keep_blank_values=0, strict_parsing=0):
                """Constructor.  Read multipart/* until last part.
        
                Arguments, all optional:
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/cgi.py - About 1 hr to fix

          Function write has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def write(self, filename, arcname=None, compress_type=None):
                  """Put the bytes from filename into the archive under the name
                  arcname."""
                  if not self.fp:
                      raise RuntimeError(
          Severity: Minor
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/zipfile.py - About 1 hr to fix

            Method ParseSubCharsCommand has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    static bool ParseSubCharsCommand(int numForms, CommandSubCharsSet[] forms,
                        string commandString, ArrayList indices)
                    {
                        indices.Clear();
                        int numUsedChars = 0;
            Severity: Minor
            Found in vector-uefi/insyde/7zip/CS/7zip/Common/CommandLineParser.cs - About 1 hr to fix

              Function Main has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              def Main():
                  try:
                      #
                      # Check input parameter
                      #
              Severity: Minor
              Found in BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.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 MakePythonSyntaxCheckTests has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              def MakePythonSyntaxCheckTests():
                  def GetAllPythonSourceFiles():
                      pythonSourceFiles = []
                      for (root, dirs, files) in os.walk(TestTools.PythonSourceDir):
                          for filename in files:
              Severity: Minor
              Found in BaseTools/Tests/CheckPythonSyntax.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 GenerateVpdFile has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def GenerateVpdFile (self, MapFileName, BinFileName):
                      #Open an VPD file to process
              
                      try:
                          fVpdFile  = open (BinFileName, "wb", 0)               
              Severity: Minor
              Found in BaseTools/Source/Python/BPDG/GenVpd.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 __GetNextToken has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __GetNextToken(self):
                      # Skip leading spaces, if exist.
                      self.__SkipWhiteSpace()
                      if self.__EndOfFile():
                          return False
              Severity: Minor
              Found in BaseTools/Source/Python/Common/FdfParserLite.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

              Method FillDistancesPrices has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  void FillDistancesPrices()
                  {
                      for (int i = Base.kStartPosModelIndex; i < Base.kNumFullDistances; i++)
                      {
                          int posSlot = GetPosSlot(i);
              Severity: Minor
              Found in vector-uefi/insyde/7zip/Java/SevenZip/Compression/LZMA/Encoder.java - 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 printList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def printList(Key, List):
                      if type(List) == type([]):
                          if len(List) > 0:
                              if Key.find(TAB_SPLIT) != -1:
                                  print "\n" + Key
              Severity: Minor
              Found in BaseTools/Source/Python/Common/TargetTxtClassObject.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 __GetSetStatement has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __GetSetStatement(self, Obj):
                      if self.__IsKeyword("SET"):
                          PcdPair = self.__GetNextPcdName()
                          
                          if not self.__IsToken( "="):
              Severity: Minor
              Found in BaseTools/Source/Python/Common/FdfParserLite.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 RemoveDupOption has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              def RemoveDupOption(OptionString, Which="/I", Against=None):
                  OptionList = OptionString.split()
                  ValueList = []
                  if Against:
                      ValueList += Against
              Severity: Minor
              Found in BaseTools/Source/Python/Common/String.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 __GetInfStatement has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __GetInfStatement(self, Obj, ForCapsule = False, MacroDict = {}):
              
                      if not self.__IsKeyword( "INF"):
                          return False
                      
              Severity: Minor
              Found in BaseTools/Source/Python/Common/FdfParserLite.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 a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __init__(self,SkuIdentifier='', SkuIds={}):
                      
                      self.AvailableSkuIds = sdict()
                      self.SkuIdSet = []
                      
              Severity: Minor
              Found in BaseTools/Source/Python/Common/Misc.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 __GetBlockStatement has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __GetBlockStatement(self, Obj):
                      if not self.__IsKeyword( "BlockSize"):
                          return False
                      
                      if not self.__IsToken( "="):
              Severity: Minor
              Found in BaseTools/Source/Python/Common/FdfParserLite.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 GetLineNo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              def GetLineNo(FileContent, Line, IsIgnoreComment=True):
                  LineList = FileContent.splitlines()
                  for Index in range(len(LineList)):
                      if LineList[Index].find(Line) > -1:
                          #
              Severity: Minor
              Found in BaseTools/Source/Python/Common/String.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 __GetFv has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __GetFv(self):
                      if not self.__GetNextToken():
                          return False
              
                      S = self.__Token.upper()
              Severity: Minor
              Found in BaseTools/Source/Python/Common/FdfParserLite.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 __GetAddressStatements has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __GetAddressStatements(self, Obj):
                      
                      if self.__IsKeyword("BsBaseAddress"):
                          if not self.__IsToken( "="):
                              raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
              Severity: Minor
              Found in BaseTools/Source/Python/Common/FdfParserLite.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

              Severity
              Category
              Status
              Source
              Language