hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid too many return statements within this method.
Open

                    return Backward(out backRes, cur);
Severity: Major
Found in vector-uefi/insyde/7zip/CS/7zip/Compress/LZMA/LzmaEncoder.cs - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                            return;
    Severity: Major
    Found in vector-uefi/insyde/7zip/CS/7zip/Compress/LZMA/LzmaEncoder.cs - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return p, q, v
      Severity: Major
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/colorsys.py - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return 1;
        Severity: Major
        Found in vector-uefi/insyde/7zip/CS/7zip/Compress/LZMA/LzmaEncoder.cs - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return v, p, q
          Severity: Major
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/colorsys.py - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return LzmaBench.LzmaBenchmark(numIterations, (UInt32)dictionary);
            Severity: Major
            Found in vector-uefi/insyde/7zip/CS/7zip/Compress/LzmaAlone/LzmaAlone.cs - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return 0;
              Severity: Major
              Found in vector-uefi/insyde/7zip/CS/7zip/Compress/LzmaAlone/LzmaAlone.cs - About 30 mins to fix

                Function GetRealFileLine has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def GetRealFileLine (File, Line):
                    
                    InsertedLines = 0
                    for Profile in IncludeFileList:
                        if Line >= Profile.InsertStartLineNumber and Line < Profile.InsertStartLineNumber + Profile.InsertAdjust + len(Profile.FileLinesList):
                Severity: Minor
                Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 25 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 CopyBlock has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public void CopyBlock(int distance, int len) throws IOException
                    {
                        int pos = _pos - distance - 1;
                        if (pos < 0)
                            pos += _windowSize;
                Severity: Minor
                Found in vector-uefi/insyde/7zip/Java/SevenZip/Compression/LZ/OutWindow.java - About 25 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 Backward has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    int Backward(int cur)
                    {
                        _optimumEndIndex = cur;
                        int posMem = _optimum[cur].PosPrev;
                        int backMem = _optimum[cur].BackPrev;
                Severity: Minor
                Found in vector-uefi/insyde/7zip/Java/SevenZip/Compression/LZMA/Encoder.java - About 25 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 DecodeBit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public int DecodeBit(short []probs, int index) throws IOException
                    {
                        int prob = probs[index];
                        int newBound = (Range >>> kNumBitModelTotalBits) * prob;
                        if ((Code ^ 0x80000000) < (newBound ^ 0x80000000))

                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 _GenOffsetValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _GenOffsetValue(self):
                        if self.PcdOffset != "*" :
                            try:
                                self.PcdBinOffset = int (self.PcdOffset)
                            except:
                Severity: Minor
                Found in BaseTools/Source/Python/BPDG/GenVpd.py - About 25 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 GetLogSize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    static int GetLogSize(int size)
                    {
                        for (int i = kSubBits; i < 32; i++)
                            for (int j = 0; j < (1 << kSubBits); j++)
                                if (size <= ((1) << i) + (j << (i - kSubBits)))
                Severity: Minor
                Found in vector-uefi/insyde/7zip/Java/SevenZip/LzmaBench.java - About 25 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 DecodeWithMatchByte has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                            public byte DecodeWithMatchByte(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, byte matchByte) throws IOException
                            {
                                int symbol = 1;
                                do
                                {
                Severity: Minor
                Found in vector-uefi/insyde/7zip/Java/SevenZip/Compression/LZMA/Decoder.java - About 25 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 printDict has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def printDict(Dict):
                        if Dict != None:
                            KeyList = Dict.keys()
                            for Key in KeyList:
                                if Dict[Key] != '':
                Severity: Minor
                Found in BaseTools/Source/Python/Common/TargetTxtClassObject.py - About 25 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 __SkipToToken has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __SkipToToken(self, String, IgnoreCase = False):
                        StartPos = self.GetFileBufferPos()
                        
                        self.__SkippedChars = ""
                        while not self.__EndOfFile():
                Severity: Minor
                Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 25 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 GetHelpTextList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def GetHelpTextList(HelpTextClassList):
                    List = []
                    if HelpTextClassList:
                        for HelpText in HelpTextClassList:
                            if HelpText.String.endswith('\n'):
                Severity: Minor
                Found in BaseTools/Source/Python/Common/String.py - About 25 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 CheckFileExist has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def CheckFileExist(WorkspaceDir, CheckFilename, ContainerFilename, SectionName, Line, LineNo= -1):
                    CheckFile = ''
                    if CheckFilename != '' and CheckFilename != None:
                        CheckFile = WorkspaceFile(WorkspaceDir, CheckFilename)
                        if not os.path.isfile(CheckFile):
                Severity: Minor
                Found in BaseTools/Source/Python/Common/String.py - About 25 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 CheckFileType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def CheckFileType(CheckFilename, ExtName, ContainerFilename, SectionName, Line, LineNo= -1):
                    if CheckFilename != '' and CheckFilename != None:
                        (Root, Ext) = os.path.splitext(CheckFilename)
                        if Ext.upper() != ExtName.upper():
                            ContainerFile = open(ContainerFilename, 'r').read()
                Severity: Minor
                Found in BaseTools/Source/Python/Common/String.py - About 25 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 GetRelPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def GetRelPath(Path1, Path2):
                    FileName = os.path.basename(Path2)
                    L1 = os.path.normpath(Path1).split(os.path.normpath('/'))
                    L2 = os.path.normpath(Path2).split(os.path.normpath('/'))
                    for Index in range(0, len(L1)):
                Severity: Minor
                Found in BaseTools/Source/Python/Common/Misc.py - About 25 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

                Severity
                Category
                Status
                Source
                Language