hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function SectionHeaderParser has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

    def SectionHeaderParser(self, SectionString, FileName, LineNo):
        _Scope = []
        _SectionName = ''
        ArchList = set()
        _ValueList = []
Severity: Minor
Found in BaseTools/Source/Python/UPT/Parser/InfSectionParser.py - About 1 day 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 Start has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

    def Start(self):
        NmakeLine = ''
        Content = ''
        try:
            Content = open(str(self.MetaFile), 'r').readlines()
Severity: Minor
Found in BaseTools/Source/Python/Workspace/MetaFileParser.py - About 1 day 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 _GetPcd has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

    def _GetPcd(self, Type):
        Pcds = sdict()
        PcdDict = tdict(True, 4)
        PcdList = []
        RecordList = self._RawData[Type, self._Arch, self._Platform]
Severity: Minor
Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 1 day 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 getcallargs has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

def getcallargs(func, *positional, **named):
    """Get the mapping of arguments to values.

    A dict is returned, with keys the function argument names (including the
    names of the * and ** arguments, if any), and values the respective bound
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/inspect.py - About 1 day 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 dis has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

def dis(pickle, out=None, memo=None, indentlevel=4):
    """Produce a symbolic disassembly of a pickle.

    'pickle' is a file-like object, or string, containing a (at least one)
    pickle.  The pickle is disassembled from the current position, through
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pickletools.py - About 1 day 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 getcallargs has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

def getcallargs(func, *positional, **named):
    """Get the mapping of arguments to values.

    A dict is returned, with keys the function argument names (including the
    names of the * and ** arguments, if any), and values the respective bound
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/inspect.py - About 1 day 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 dis has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

def dis(pickle, out=None, memo=None, indentlevel=4):
    """Produce a symbolic disassembly of a pickle.

    'pickle' is a file-like object, or string, containing a (at least one)
    pickle.  The pickle is disassembled from the current position, through
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/pickletools.py - About 1 day 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 Main2 has a Cognitive Complexity of 78 (exceeds 20 allowed). Consider refactoring.
Open

        static int Main2(string[] args)
        {
            System.Console.WriteLine("\nLZMA# 4.61  2008-11-23\n");

            if (args.Length == 0)
Severity: Minor
Found in vector-uefi/insyde/7zip/CS/7zip/Compress/LzmaAlone/LzmaAlone.cs - About 1 day 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

IMAP4 has 67 functions (exceeds 20 allowed). Consider refactoring.
Open

class IMAP4:

    """IMAP4 client class.

    Instantiate with: IMAP4([host[, port]])
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/imaplib.py - About 1 day to fix

    IMAP4 has 67 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class IMAP4:
    
        """IMAP4 client class.
    
        Instantiate with: IMAP4([host[, port]])
    Severity: Major
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/imaplib.py - About 1 day to fix

      File pstats.py has 575 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Class for printing reports on profiled python code."""
      
      # Class for printing reports on profiled python code. rev 1.0  4/1/94
      #
      # Based on prior profile module by Sjoerd Mullender...
      Severity: Major
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pstats.py - About 1 day to fix

        File spi.py has 575 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        #!/usr/local/bin/python
        #CHIPSEC: Platform Security Assessment Framework
        #Copyright (c) 2010-2014, Intel Corporation
        # 
        #This program is free software; you can redistribute it and/or
        Severity: Major
        Found in vector-uefi/fd/tool/chipsec/hal/spi.py - About 1 day to fix

          File pstats.py has 575 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """Class for printing reports on profiled python code."""
          
          # Class for printing reports on profiled python code. rev 1.0  4/1/94
          #
          # Based on prior profile module by Sjoerd Mullender...
          Severity: Major
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/pstats.py - About 1 day to fix

            Function GenLibraryClasses has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
            Open

            def GenLibraryClasses(ModuleObject):
                #
                # generate [LibraryClasses] section
                #
                Content = ''
            Severity: Minor
            Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py - About 1 day 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 SetValueDatumTypeMaxSizeToken has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
            Open

            def SetValueDatumTypeMaxSizeToken(PcdItem, CurrentLineOfPcdItem, PcdItemObj, Arch, PackageInfo = None):
                #
                # Package information not been generated currently, we need to parser INF file to get information. 
                #
                if not PackageInfo:
            Severity: Minor
            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 1 day 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 SetProtocol has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
            Open

                def SetProtocol(self, ProtocolContent, Arch = None,):
                    __SupArchList = []
                    for ArchItem in Arch:
                        #
                        # Validate Arch
            Severity: Minor
            Found in BaseTools/Source/Python/UPT/Object/Parser/InfProtocolObject.py - About 1 day 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 ParseGuidComment has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
            Open

            def ParseGuidComment(CommentsList, InfGuidItemObj):
                #
                # Get/Set Usage and HelpString
                #
                if CommentsList != None and len(CommentsList) != 0 :
            Severity: Minor
            Found in BaseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py - About 1 day 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 __GetOptRomOverrides has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
            Open

                def __GetOptRomOverrides(self, Obj):
                    if self.__IsToken('{'):
                        Overrides = OptionRom.OverrideAttribs()
                        while True:
                            if self.__IsKeyword( "PCI_VENDOR_ID"):
            Severity: Minor
            Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 1 day 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 CheckBooleanValueComparison has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
            Open

            def CheckBooleanValueComparison(FullFileName):
                ErrorMsgList = []
            
                FileID = GetTableID(FullFileName, ErrorMsgList)
                if FileID < 0:
            Severity: Minor
            Found in BaseTools/Source/Python/Ecc/c.py - About 1 day 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 CheckPointerNullComparison has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
            Open

            def CheckPointerNullComparison(FullFileName):
                ErrorMsgList = []
            
                FileID = GetTableID(FullFileName, ErrorMsgList)
                if FileID < 0:
            Severity: Minor
            Found in BaseTools/Source/Python/Ecc/c.py - About 1 day 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