hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                        if CleanString(NewItem) == '':
                            continue
                        (K1, K2, K3, K4, K5, K6) = GetDynamicDefaultPcd(NewItem, Type, Filename, -1)
Severity: Major
Found in BaseTools/Source/Python/Common/DscClassObject.py - About 45 mins to fix

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

        def __GetNextOp(self):
            # Skip leading spaces, if exist.
            self.__SkipWhiteSpace()
            if self.__EndOfFile():
                return False
    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

    Method Init has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        void Init() throws IOException
        {
            m_OutWindow.Init(false);
            
            SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsMatchDecoders);
    Severity: Minor
    Found in vector-uefi/insyde/7zip/Java/SevenZip/Compression/LZMA/Decoder.java - 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 CleanString(NewItem) == '':
                                continue
                            (Family, ToolChain, Flag) = GetBuildOption(NewItem, Filename, -1)
    Severity: Major
    Found in BaseTools/Source/Python/Common/DscClassObject.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (lenTest < numAvailableBytesFull)
                              {
                                  int t = Math.min(numAvailableBytesFull - 1 - lenTest, _numFastBytes);
                                  int lenTest2 = _matchFinder.GetMatchLen(lenTest, curBack, t);
                                  if (lenTest2 >= 2)
      Severity: Major
      Found in vector-uefi/insyde/7zip/Java/SevenZip/Compression/LZMA/Encoder.java - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                for NewItem in open(Filename, 'r').readlines():
                                    if CleanString(NewItem) == '':
                                        continue
                                    MergeArches(Libraries, NewItem, Arch)
        
        Severity: Major
        Found in BaseTools/Source/Python/Common/DscClassObject.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if CleanString(NewItem) == '':
                                      continue
                                  MergeArches(LibraryClasses, GetLibraryClass([NewItem, IncludeFile[4]], Filename, self.WorkspaceDir, -1), Arch)
          Severity: Major
          Found in BaseTools/Source/Python/Common/DscClassObject.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if NewKey not in self.ToolsDefTxtDictionary:
                                        self.ToolsDefTxtDictionary[NewKey] = self.ToolsDefTxtDictionary[Key]
                                    continue
            Severity: Major
            Found in BaseTools/Source/Python/Common/ToolDefClassObject.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if CleanString(NewItem) == '':
                                          continue
                                      (TokenName, TokenGuidCName, Value, DatumType, MaxDatumSize, Type) = GetPcd(NewItem, Type, Filename, -1)
              Severity: Major
              Found in BaseTools/Source/Python/Common/DscClassObject.py - About 45 mins to fix

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

                    def __ReplaceFragment(self, StartPos, EndPos, Value = ' '):
                        if StartPos[0] == EndPos[0]:
                            Offset = StartPos[1]
                            while Offset <= EndPos[1]:
                                self.Profile.FileLinesList[StartPos[0]][Offset] = Value
                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 (curAndLenPrice < optimum.Price)
                                            {
                                                optimum.Price = curAndLenPrice;
                                                optimum.PosPrev = cur + lenTest + 1;
                                                optimum.BackPrev = 0;
                Severity: Major
                Found in vector-uefi/insyde/7zip/Java/SevenZip/Compression/LZMA/Encoder.java - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if eachUnfixedPcd.PcdOffset == '*' :
                                              # The offset un-fixed pcd can write into this free space
                                              if needFixPcdSize <= (NowOffset - LastOffset) :
                                                  # Change the offset value of un-fixed pcd
                                                  eachUnfixedPcd.PcdOffset    = str(hex(LastOffset))
                  Severity: Major
                  Found in BaseTools/Source/Python/BPDG/GenVpd.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if self.IsToDatabase:
                                                SqlCommand = """update %s set Value1 = '%s', Value2 = '%s'
                                                                where ID = %s""" % (self.TblDsc.Table, ConvertToSqlString2(List[0]), ConvertToSqlString2(List[1]), Record[3])
                                                self.TblDsc.Exec(SqlCommand)
                    
                    Severity: Major
                    Found in BaseTools/Source/Python/Common/DscClassObject.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)
                                              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 not self.__IsToken( ")"):
                                                    raise Warning("expected ')'", self.FileName, self.CurrentLineNumber)
                                                self.__Token = 'PCD('+PcdPair[1]+'.'+PcdPair[0]+')'
                        Severity: Major
                        Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if Value != None: break
                                      else:
                          Severity: Major
                          Found in BaseTools/Source/Python/Common/Misc.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if os.path.exists(Str):
                                                        if not os.path.isabs(Str):
                                                            Str = os.path.abspath(Str)
                                                    IncFileName = Str
                            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.__GetNextOp():
                                                          raise Warning("expected !endif At Line ", self.FileName, self.CurrentLineNumber)
                                                  
                              Severity: Major
                              Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if self.__GetStringData():
                                                            pass
                                                        MacroValue = 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 not self.__IsToken(","):
                                                              break
                                                      
                                  Severity: Major
                                  Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language