hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function itertext has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def itertext(self):
        tag = self.tag
        if not isinstance(tag, basestring) and tag is not None:
            return
        if self.text:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/etree/ElementTree.py - About 45 mins 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 _handleModuleFixture has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def _handleModuleFixture(self, test, result):
        previousModule = self._get_previous_module(result)
        currentModule = test.__class__.__module__
        if currentModule == previousModule:
            return
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/unittest/suite.py - About 45 mins 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

Avoid deeply nested control flow statements.
Open

                        if attr.value == id:
                            result = node
            if result is not None:
Severity: Major
Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/dom/minidom.py - About 45 mins to fix

    Function _parse_feature_string has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def _parse_feature_string(s):
        features = []
        parts = s.split()
        i = 0
        length = len(parts)
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/dom/domreg.py - About 45 mins 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

    Avoid deeply nested control flow statements.
    Open

                            if attr.value == id:
                                result = node
                            elif not node._magic_id_nodes:
                                break
                        elif attr._is_id:
    Severity: Major
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/dom/minidom.py - About 45 mins to fix

      Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, stream=sys.stderr, descriptions=True, verbosity=1,
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/unittest/runner.py - About 45 mins to fix

        Function getDOMImplementation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def getDOMImplementation(features=None):
            if features:
                if isinstance(features, StringTypes):
                    features = domreg._parse_feature_string(features)
                for f, v in features:
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/dom/minidom.py - About 45 mins 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

        Avoid deeply nested control flow statements.
        Open

                                if info.isIdNS(attr.namespaceURI, attr.localName):
                                    self._id_cache[attr.value] = node
                                    if attr.value == id:
                                        result = node
                                    elif not node._magic_id_nodes:
        Severity: Major
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/dom/minidom.py - About 45 mins to fix

          Function start_element_ns has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def start_element_ns(self, name, attrs):
                  pair = name.split()
                  if len(pair) == 1:
                      # no namespace
                      pair = (None, name)
          Severity: Minor
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/sax/expatreader.py - About 45 mins 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 write has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def write(self, file_or_filename,
          Severity: Minor
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/etree/ElementTree.py - About 45 mins to fix

            Function getnode has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            def getnode():
                """Get the hardware address as a 48-bit positive integer.
            
                The first time this runs, it may launch a separate program, which could
                be quite slow.  If all attempts to obtain the hardware address fail, we
            Severity: Minor
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/uuid.py - About 45 mins 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 randrange has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def randrange(self, start, stop=None, step=1, int=int, default=None,
            Severity: Minor
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/random.py - About 45 mins to fix

              Function redirect_internal has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def redirect_internal(self, url, fp, errcode, errmsg, headers, data):
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/urllib.py - About 45 mins to fix

                Function open_data has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def open_data(self, url, data=None):
                        """Use "data" URL."""
                        if not isinstance(url, str):
                            raise IOError, ('data error', 'proxy support for data protocol currently not implemented')
                        # ignore POSTed data
                Severity: Minor
                Found in vector-uefi/fd/efi/StdLib/lib/python.27/urllib.py - About 45 mins 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

                Avoid deeply nested control flow statements.
                Open

                                    for v, k in sorted(namespaces.items(),
                                                       key=lambda x: x[1]):  # sort on prefix
                                        if k:
                                            k = ":" + k
                                        write(" xmlns%s=\"%s\"" % (
                Severity: Major
                Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/etree/ElementTree.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      for v, k in sorted(namespaces.items(),
                                                         key=lambda x: x[1]):  # sort on prefix
                                          if k:
                                              k = ":" + k
                                          write(" xmlns%s=\"%s\"" % (
                  Severity: Major
                  Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/etree/ElementTree.py - About 45 mins to fix

                    Function find_head_package has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def find_head_package(self, parent, name):
                            if '.' in name:
                                i = name.find('.')
                                head = name[:i]
                                tail = name[i+1:]
                    Severity: Minor
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/ihooks.py - About 45 mins 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 http_error_401 has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def http_error_401(self, url, fp, errcode, errmsg, headers, data=None):
                    Severity: Minor
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/urllib.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if words[i] in hw_identifiers:
                                                  return int(
                                                      words[get_index(i)].replace(':', ''), 16)
                              except IOError:
                      Severity: Major
                      Found in vector-uefi/fd/efi/StdLib/lib/python.27/uuid.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if isinstance(k, QName):
                                                k = k.text
                                            if isinstance(v, QName):
                        Severity: Major
                        Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/etree/ElementTree.py - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language