hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

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

def ParseHeaderCommentSection(CommentList, FileName = None):
    
    Abstract = ''
    Description = ''
    Copyright = ''
Severity: Minor
Found in BaseTools/Source/Python/Ecc/MetaDataParser.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 DisPatchDxe has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
Open

    def DisPatchDxe(self, Db):
        IsInstalled = False
        ScheduleList = sdict()
        for FfsID in self.UnDispatchedFfsDict:
            CouldBeLoaded = False
Severity: Minor
Found in BaseTools/Source/Python/Eot/FvImage.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 complete has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
Open

    def complete(self):
        self.indentsize = 1
        stack = []
        todo = []
        thisid = ''
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/pindent.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 win32_ver has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
Open

def win32_ver(release='',version='',csd='',ptype=''):

    """ Get additional version information from the Windows Registry
        and return a tuple (version,csd,ptype) referring to version
        number, CSD level and OS type (multi/single
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/platform.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 _serialize_html has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
Open

def _serialize_html(write, elem, encoding, qnames, namespaces):
    tag = elem.tag
    text = elem.text
    if tag is Comment:
        write("<!--%s-->" % _escape_cdata(text, encoding))
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/etree/ElementTree.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 win32_ver has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
Open

def win32_ver(release='',version='',csd='',ptype=''):

    """ Get additional version information from the Windows Registry
        and return a tuple (version,csd,ptype) referring to version
        number, CSD level and OS type (multi/single
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/platform.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 _serialize_html has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
Open

def _serialize_html(write, elem, encoding, qnames, namespaces):
    tag = elem.tag
    text = elem.text
    if tag is Comment:
        write("<!--%s-->" % _escape_cdata(text, encoding))
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/etree/ElementTree.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

File msvc9compiler.py has 572 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""distutils.msvc9compiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio 2008.

    File msvc9compiler.py has 572 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """distutils.msvc9compiler
    
    Contains MSVCCompiler, an implementation of the abstract CCompiler class
    for the Microsoft Visual Studio 2008.
    
    Severity: Major
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/msvc9compiler.py - About 1 day to fix

      File Misc.py has 570 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      ## @file
      # Common routines used by all tools
      #
      # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
      #
      Severity: Major
      Found in BaseTools/Source/Python/UPT/Library/Misc.py - About 1 day to fix

        Consider simplifying this complex logical expression.
        Open

                            if LA52 == IDENTIFIER or LA52 == 29 or LA52 == 30 or LA52 == 31 or LA52 == 32 or LA52 == 33 or LA52 == 34 or LA52 == 35 or LA52 == 36 or LA52 == 37 or LA52 == 38 or LA52 == 39 or LA52 == 40 or LA52 == 41 or LA52 == 42 or LA52 == 45 or LA52 == 46 or LA52 == 48 or LA52 == 49 or LA52 == 50 or LA52 == 51 or LA52 == 52 or LA52 == 53 or LA52 == 54 or LA52 == 55 or LA52 == 56 or LA52 == 57 or LA52 == 58 or LA52 == 59 or LA52 == 60 or LA52 == 61 or LA52 == 63:
                                alt52 = 2
                            elif LA52 == 66:
                                LA52_18 = self.input.LA(3)
        
        Severity: Critical
        Found in BaseTools/Source/Python/Ecc/CParser.py - About 1 day to fix

          Consider simplifying this complex logical expression.
          Open

                              if LA52 == IDENTIFIER or LA52 == 29 or LA52 == 30 or LA52 == 31 or LA52 == 32 or LA52 == 33 or LA52 == 34 or LA52 == 35 or LA52 == 36 or LA52 == 37 or LA52 == 38 or LA52 == 39 or LA52 == 40 or LA52 == 41 or LA52 == 42 or LA52 == 45 or LA52 == 46 or LA52 == 48 or LA52 == 49 or LA52 == 50 or LA52 == 51 or LA52 == 52 or LA52 == 53 or LA52 == 54 or LA52 == 55 or LA52 == 56 or LA52 == 57 or LA52 == 58 or LA52 == 59 or LA52 == 60 or LA52 == 61 or LA52 == 63:
                                  alt52 = 2
                              elif LA52 == 66:
                                  LA52_18 = self.input.LA(3)
          
          Severity: Critical
          Found in BaseTools/Source/Python/Eot/CParser.py - About 1 day to fix

            Function GenModuleHeader has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
            Open

                def GenModuleHeader(self, ContainerFile):
                    EdkLogger.debug(2, "Generate ModuleHeader ...")
                    File = self.Identification.FileFullPath
                    #
                    # Update all defines item in database
            Severity: Minor
            Found in BaseTools/Source/Python/Common/InfClassObject.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 SetPpi has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
            Open

                def SetPpi(self, PpiList, Arch = None):
                    __SupArchList = []
                    for ArchItem in Arch:
                        #
                        # Validate Arch
            Severity: Minor
            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPpiObject.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 GetPostfixNotation has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
            Open

                def GetPostfixNotation(self):
                    Stack = []
                    LastToken = ''
                    for Token in self.TokenList:
                        if Token == "(":
            Severity: Minor
            Found in BaseTools/Source/Python/AutoGen/GenDepex.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 _GetToolDefinition has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
            Open

                def _GetToolDefinition(self):
                    if self._ToolDefinitions == None:
                        ToolDefinition = self.Workspace.ToolDef.ToolsDefTxtDictionary
                        if TAB_TOD_DEFINES_COMMAND_TYPE not in self.Workspace.ToolDef.ToolsDefTxtDatabase:
                            EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "No tools found in configuration",
            Severity: Minor
            Found in BaseTools/Source/Python/AutoGen/AutoGen.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 CheckNonBooleanValueComparison has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
            Open

            def CheckNonBooleanValueComparison(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 _install_message has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
            Open

                def _install_message(self, message):
                    """Write message contents and return (start, stop)."""
                    start = self._file.tell()
                    if isinstance(message, BabylMessage):
                        special_labels = []
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/mailbox.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 _serialize_xml has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
            Open

            def _serialize_xml(write, elem, encoding, qnames, namespaces):
                tag = elem.tag
                text = elem.text
                if tag is Comment:
                    write("<!--%s-->" % _encode(text, encoding))
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/etree/ElementTree.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 makeSet_fast has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
            Open

                def makeSet_fast(self, token, sets, i):
                    #
                    #  Call *only* when the entire state machine has been built!
                    #  It relies on self.edges being filled in completely, and
                    #  then duplicates and inlines code to boost speed at the
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Parser/spark.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