hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function Main has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

def Main():
    Logger.Initialize()

    Parser = OptionParser(version=(MSG_VERSION + ' ' + gBUILD_VERSION), description=MSG_DESCRIPTION,
                          prog="UPT.exe", usage=MSG_USAGE)
Severity: Minor
Found in BaseTools/Source/Python/UPT/UPT.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 InfBinaryParser has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    def InfBinaryParser(self, SectionString, InfSectionObject, FileName):
        #
        # Macro defined in this section 
        #
        SectionMacros = {}
Severity: Minor
Found in BaseTools/Source/Python/UPT/Parser/InfBinarySectionParser.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 __GenComplexFileSection__ has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    def __GenComplexFileSection__(self, Rule, FvChildAddr, FvParentAddr):
        if self.ModuleType in ('SEC', 'PEI_CORE', 'PEIM'):
            if Rule.KeepReloc != None:
                self.KeepRelocFromRule = Rule.KeepReloc
        SectFiles = []
Severity: Minor
Found in BaseTools/Source/Python/GenFds/FfsInfStatement.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 AddToBuffer has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    def AddToBuffer (self, Buffer, BaseAddress=None, BlockSize= None, BlockNum=None, ErasePloarity='1', VtfDict=None, MacroDict = {}) :

        if BaseAddress == None and self.UiFvName.upper() + 'fv' in GenFds.ImageBinDict.keys():
            return GenFds.ImageBinDict[self.UiFvName.upper() + 'fv']
        
Severity: Minor
Found in BaseTools/Source/Python/GenFds/Fv.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 _BuildModule has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    def _BuildModule(self):
        for BuildTarget in self.BuildTargetList:
            GlobalData.gGlobalDefines['TARGET'] = BuildTarget
            for ToolChain in self.ToolChainList:
                GlobalData.gGlobalDefines['TOOLCHAIN'] = ToolChain
Severity: Minor
Found in BaseTools/Source/Python/build/build.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 ProcessBuildTargetList has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    def ProcessBuildTargetList(self):
        #
        # Search dependency file list for each source file
        #
        ForceIncludedFile = []
Severity: Minor
Found in BaseTools/Source/Python/AutoGen/GenMake.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 declarator has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    def declarator(self, ):

        retval = self.declarator_return()
        retval.start = self.input.LT(1)
        declarator_StartIndex = self.input.index()
Severity: Minor
Found in BaseTools/Source/Python/Ecc/CParser.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 declarator has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    def declarator(self, ):

        retval = self.declarator_return()
        retval.start = self.input.LT(1)
        declarator_StartIndex = self.input.index()
Severity: Minor
Found in BaseTools/Source/Python/Eot/CParser.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 digest_chunk has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

def digest_chunk(chunk, branch=None):
    """Digest a chunk -- extract working file name and revisions"""
    lines = chunk[0]
    key = 'Working file:'
    keylen = len(key)
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/logmerge.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 __run has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    def __run(self, test, compileflags, out):
        """
        Run the examples in `test`.  Write the outcome of each example
        with one of the `DocTestRunner.report_*` methods, using the
        writer function `out`.  `compileflags` is the set of compiler
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/doctest.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 writepy has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    def writepy(self, pathname, basename = ""):
        """Add all files from "pathname" to the ZIP archive.

        If pathname is a package directory, search the directory and
        all package subdirectories recursively for all *.py and enter
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/zipfile.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 send_metadata has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    def send_metadata(self):
        ''' Send the metadata to the package index server.

            Well, do the following:
            1. figure who the user is, and then

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 52 (exceeds 5 allowed). Consider refactoring.
Open

    def __run(self, test, compileflags, out):
        """
        Run the examples in `test`.  Write the outcome of each example
        with one of the `DocTestRunner.report_*` methods, using the
        writer function `out`.  `compileflags` is the set of compiler
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/doctest.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 writepy has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    def writepy(self, pathname, basename = ""):
        """Add all files from "pathname" to the ZIP archive.

        If pathname is a package directory, search the directory and
        all package subdirectories recursively for all *.py and enter
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/zipfile.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 send_metadata has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    def send_metadata(self):
        ''' Send the metadata to the package index server.

            Well, do the following:
            1. figure who the user is, and then
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/command/register.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 add_ui has 200 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def add_ui(db):
    x = y = 50
    w = 370
    h = 300
    title = "[ProductName] Setup"
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/msi/msi.py - About 1 day to fix

    Scanner has 56 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Scanner:
    
        # Set to 1 in subclass to debug your scanner patterns.
        debug = 0
    
    Severity: Major
    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/bgen/bgen/scantools.py - About 1 day to fix

      UserString has 56 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class UserString(collections.Sequence):
          def __init__(self, seq):
              if isinstance(seq, basestring):
                  self.data = seq
              elif isinstance(seq, UserString):
      Severity: Major
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/UserString.py - About 1 day to fix

        UserString has 56 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class UserString(collections.Sequence):
            def __init__(self, seq):
                if isinstance(seq, basestring):
                    self.data = seq
                elif isinstance(seq, UserString):
        Severity: Major
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/UserString.py - About 1 day to fix

          File mimetypes.py has 498 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """Guess the MIME type of a file.
          
          This module defines two useful functions:
          
          guess_type(url, strict=1) -- guess the MIME type and encoding of a URL.
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/mimetypes.py - About 7 hrs to fix
            Severity
            Category
            Status
            Source
            Language