hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                        if not self.__IsToken( "("):
                            raise Warning("expected '('", self.FileName, self.CurrentLineNumber)
                        PcdPair = self.__GetNextPcdName()
Severity: Major
Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if IfList[-1][2]:
                                IfList[-1][1] = False
                            else:
                                IfList[-1][2] = True
                                self.__WipeOffArea.append((IfList[-1][0], (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
    Severity: Major
    Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if MacroVal > InputVal:
                                  return True
                              else:
                                  return False
                          elif Op == '>=':
      Severity: Major
      Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

        Function CheckFileExist has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def CheckFileExist(WorkspaceDir, CheckFilename, ContainerFilename, SectionName, Line, LineNo= -1):
        Severity: Minor
        Found in BaseTools/Source/Python/Common/String.py - About 45 mins to fix

          Function __GetRegionFileType has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def __GetRegionFileType(self, RegionObj):
          
                  if not self.__IsKeyword( "FILE"):
                      raise Warning("expected Keyword 'FILE' At Line ", self.FileName, self.CurrentLineNumber)
          
          Severity: Minor
          Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins 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

          Avoid deeply nested control flow statements.
          Open

                                  if MacroVal < InputVal:
                                      return True
                                  else:
                                      return False
                              elif Op == '<=':
          Severity: Major
          Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

            Function GetSingleValueOfKeyFromLines has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def GetSingleValueOfKeyFromLines(Lines, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):
            Severity: Minor
            Found in BaseTools/Source/Python/Common/String.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if Key[0] not in Keys:
                                      Dictionary[Key[0]] = Value
                                      Keys.append(Key[0])
                                  else:
                                      Dictionary[Key[0]].extend(Value)
              Severity: Major
              Found in BaseTools/Source/Python/Common/String.py - About 45 mins to fix

                Function __GetRegionFvType has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __GetRegionFvType(self, RegionObj):
                
                        if not self.__IsKeyword( "FV"):
                            raise Warning("expected Keyword 'FV' At Line ", self.FileName, self.CurrentLineNumber)
                        
                Severity: Minor
                Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins 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 __GetReferencedFdFvTuple has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __GetReferencedFdFvTuple(self, FvObj, RefFdList = [], RefFvList = []):
                        
                        for FfsObj in FvObj.FfsList:
                            if isinstance(FfsObj, FfsFileStatement.FileStatement):
                                if FfsObj.FvName != None and FfsObj.FvName.upper() not in RefFvList:
                Severity: Minor
                Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins 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

                Avoid deeply nested control flow statements.
                Open

                                        if MacroVal >= InputVal:
                                            return True
                                        else:
                                            return False
                                    elif Op == '<':
                Severity: Major
                Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if not os.path.isabs(self.FileName):
                                              FullFdf = os.path.join(os.environ.get('WORKSPACE'), self.FileName)
                                  
                  Severity: Major
                  Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if not self.__GetNextToken():
                                                raise Warning("expected value At Line ", self.FileName, self.CurrentLineNumber)
                                            if self.__GetStringData():
                    Severity: Major
                    Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if not self.__IsToken(","):
                                                  break
                                          
                      Severity: Major
                      Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if Profile.FileName == File and Profile.MacroName == Name and Profile.DefinedAtLine <= Line:
                                                    Value = Profile.MacroValue
                                                    
                        Severity: Major
                        Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if MacroVal <= InputVal:
                                                      return True
                                                  else:
                                                      return False
                                              else:
                          Severity: Major
                          Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if not Pattern.match(self.__Token):
                                                        raise Warning("expected KeyString \"Target_Tag_Arch\" At Line ", self.FileName, self.CurrentLineNumber)
                                                    FfsFileObj.KeyStringList.append(self.__Token)
                            Severity: Major
                            Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if self.__Token in ('!=', '==', '>', '<', '>=', '<='):
                                                          Op = self.__Token
                                                          if not self.__GetNextToken():
                                                              raise Warning("expected value At Line ", self.FileName, self.CurrentLineNumber)
                                                          if self.__GetStringData():
                              Severity: Major
                              Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if elementRegionData != None and elementRegionData.upper() not in FvList:
                                                            FvList.append(elementRegionData.upper())
                                        return FvList
                                Severity: Major
                                Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if Op == '>':
                                                              if MacroVal > InputVal:
                                                                  return True
                                                              else:
                                                                  return False
                                  Severity: Major
                                  Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language