hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function GetArchModuleType has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def GetArchModuleType(KeyList):
    __SupArchList = []
    __SupModuleList = []

    for (ArchItem, ModuleItem) in KeyList:

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

    def GenerateOptionRom(Output, EfiInput, BinaryInput, Compress=False, ClassCode=None,
                        Revision=None, DeviceId=None, VendorId=None):
        InputList = []   
        Cmd = ["EfiRom"]
        if len(EfiInput) > 0:
Severity: Minor
Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.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 __GetGuidAttrib has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def __GetGuidAttrib(self):

        AttribDict = {}
        AttribDict["PROCESSING_REQUIRED"] = "NONE"
        AttribDict["AUTH_STATUS_VALID"] = "NONE"
Severity: Minor
Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetRule has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def __GetRule(self):

        if not self.__GetNextToken():
            return False
Severity: Minor
Found in BaseTools/Source/Python/GenFds/FdfParser.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 GenBsfInf has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def GenBsfInf (self):
        FvList = self.GetFvList()
        self.BsfInfName = os.path.join(GenFdsGlobalVariable.FvDir, self.UiName + '.inf')
        BsfInf = open (self.BsfInfName, 'w+')
        if self.ResetBin != None:
Severity: Minor
Found in BaseTools/Source/Python/GenFds/Vtf.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 __GetReferencedFdCapTuple has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def __GetReferencedFdCapTuple(self, CapObj, RefFdList = [], RefFvList = []):

        for CapsuleDataObj in CapObj.CapsuleDataList :
            if hasattr(CapsuleDataObj, 'FvName') and CapsuleDataObj.FvName != None and CapsuleDataObj.FvName.upper() not in RefFvList:
                RefFvList.append (CapsuleDataObj.FvName.upper())
Severity: Minor
Found in BaseTools/Source/Python/GenFds/FdfParser.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 14 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, M, ReportType):
        self.ModuleName = M.Module.BaseName
        self.ModuleInfPath = M.MetaFile.File
        self.FileGuid = M.Guid
        self.Size = 0
Severity: Minor
Found in BaseTools/Source/Python/build/BuildReport.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 Insert has 14 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def Insert(self, Model, Value1, Value2, Value3, Value4, Value5, Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled):
Severity: Major
Found in BaseTools/Source/Python/Table/TableInf.py - About 1 hr to fix

    Function GetAllIncludeFiles has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def GetAllIncludeFiles(FullFileName):
        if AllIncludeFileListDict.get(FullFileName) != None:
            return AllIncludeFileListDict.get(FullFileName)
    
        FileDirName = os.path.dirname(FullFileName)
    Severity: Minor
    Found in BaseTools/Source/Python/Ecc/c.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 Insert has 14 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def Insert(self, Model, Value1, Value2, Value3, Value4, Value5, Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled):
    Severity: Major
    Found in BaseTools/Source/Python/Table/TableDec.py - About 1 hr to fix

      Function mCHARACTER_LITERAL has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def mCHARACTER_LITERAL(self, ):
      
              try:
                  self.type = CHARACTER_LITERAL
      
      Severity: Minor
      Found in BaseTools/Source/Python/Ecc/CLexer.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 InsertOneFile has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def InsertOneFile(self, File):
              #
              # Insert a record for file
              #
              FileID = self.TblFile.Insert(File.Name, File.ExtName, File.Path, File.FullPath, Model = File.Model, TimeStamp = File.TimeStamp)
      Severity: Minor
      Found in BaseTools/Source/Python/Ecc/Database.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 Insert has 14 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON', BelongsToItem=-1, BelongsToFile = -1,
      Severity: Major
      Found in BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py - About 1 hr to fix

        Function mCHARACTER_LITERAL has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def mCHARACTER_LITERAL(self, ):
        
                try:
                    self.type = CHARACTER_LITERAL
        
        Severity: Minor
        Found in BaseTools/Source/Python/Eot/CLexer.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 GeneratePpiProtocol has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def GeneratePpiProtocol(self, Model, Name, Guid, Type, CName):
                Content = """                <tr>
                          <td width="5%%"></td>
                          <td width="10%%">%s</td>
                          <td width="85%%" colspan="3">%s</td>
        Severity: Minor
        Found in BaseTools/Source/Python/Eot/Report.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 source_synopsis has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        def source_synopsis(file):
            line = file.readline()
            while line[:1] == '#' or not strip(line):
                line = file.readline()
                if not line: break
        Severity: Minor
        Found in AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.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 report has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def report(self):
                exts = self.stats.keys()
                exts.sort()
                # Get the column keys
                columns = {}
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/byext.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 help has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def help(self, request):
                if type(request) is type(''):
                    request = request.strip()
                    if request == 'help': self.intro()
                    elif request == 'keywords': self.listkeywords()
        Severity: Minor
        Found in AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.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 run has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def run(self):
        
                tests = self.tests.items()
                tests.sort()
                timer = self.get_timer()
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/pybench.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 read_chunk has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        def read_chunk(fp):
            """Read a chunk -- data for one file, ending with sep1.
        
            Split the chunk in parts separated by sep2.
        
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/logmerge.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