hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

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 vector-uefi/fd/efi/StdLib/lib/python.27/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 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 modulefinder.py has 561 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Find modules used by a script, using introspection."""
# This module should be kept compatible with Python 2.2, see PEP 291.

from __future__ import generators
import dis
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/modulefinder.py - About 1 day to fix

    File modulefinder.py has 561 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Find modules used by a script, using introspection."""
    # This module should be kept compatible with Python 2.2, see PEP 291.
    
    from __future__ import generators
    import dis
    Severity: Major
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/modulefinder.py - About 1 day to fix

      Function GetDependencyList has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
      Open

          def GetDependencyList(self, File, ForceList, SearchPathList):
              EdkLogger.debug(EdkLogger.DEBUG_1, "Try to get dependency files for %s" % File)
              FileStack = [File] + ForceList
              DependencySet = set()
      
      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 GetFilteredLanguage has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
      Open

      def GetFilteredLanguage(UniLanguageList, LanguageFilterList):
          UniLanguageListFiltered = []
          # if filter list is empty, then consider there is no filter
          if LanguageFilterList == []:
              UniLanguageListFiltered = UniLanguageList
      Severity: Minor
      Found in BaseTools/Source/Python/AutoGen/StrGather.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 main has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
      Open

      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/i18n/pygettext.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 _format has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
      Open

          def _format(self, object, stream, indent, allowance, context, level):
              level = level + 1
              objid = _id(object)
              if objid in context:
                  stream.write(_recursion(object))
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pprint.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 goahead has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
      Open

          def goahead(self, end):
              rawdata = self.rawdata
              i = 0
              n = len(rawdata)
              while i < n:
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/HTMLParser.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 compare_total has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
      Open

          def compare_total(self, other):
              """Compares self to other using the abstract representations.
      
              This is not like the standard compare, which use their numerical
              value. Note that a total ordering is defined for all possible abstract
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/decimal.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 _format has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
      Open

          def _format(self, object, stream, indent, allowance, context, level):
              level = level + 1
              objid = _id(object)
              if objid in context:
                  stream.write(_recursion(object))
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/pprint.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 goahead has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
      Open

          def goahead(self, end):
              rawdata = self.rawdata
              i = 0
              n = len(rawdata)
              while i < n:
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/HTMLParser.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 compare_total has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
      Open

          def compare_total(self, other):
              """Compares self to other using the abstract representations.
      
              This is not like the standard compare, which use their numerical
              value. Note that a total ordering is defined for all possible abstract
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/decimal.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 bdist_msi.py has 559 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

        File bdist_msi.py has 559 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

          Function GenBuildOptions has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
          Open

          def GenBuildOptions(ModuleObject):
              Content = ''
              if not ModuleObject.BinaryModule:
                  #
                  # generate [BuildOptions] section
          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

          File IpiDb.py has 546 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ## @file
          # This file is for installed package information database operations
          #
          # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
          #
          Severity: Major
          Found in BaseTools/Source/Python/UPT/Core/IpiDb.py - About 1 day to fix

            Function _GetDynamicHiiPcd has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
            Open

                def _GetDynamicHiiPcd(self, Type):
                    
                    SkuObj = SkuClass(self.SkuIdentifier,self.SkuIds)
                    
                    Pcds = sdict()
            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 SetPackages has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
            Open

                def SetPackages(self, PackageData, Arch = None):
                    IsValidFileFlag = False
                    SupArchList     = []
                    for ArchItem in Arch:
                        #
            Severity: Minor
            Found in BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.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 SetGuid has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
            Open

                def SetGuid(self, GuidList, Arch = None):
                    __SupportArchList = []
                    for ArchItem in Arch:
                        #
                        # Validate Arch
            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

            Severity
            Category
            Status
            Source
            Language