hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                        if attr.value == id:
                            result = node
            if result is not None:
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/dom/minidom.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 AppPkg/Applications/Python/Python-2.7.2/Lib/xml/etree/ElementTree.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 AppPkg/Applications/Python/Python-2.7.2/Lib/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

      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 AppPkg/Applications/Python/Python-2.7.2/Lib/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

      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 AppPkg/Applications/Python/Python-2.7.2/Lib/xml/etree/ElementTree.py - About 45 mins to fix

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

        def make_parser(parser_list = []):
            """Creates and returns a SAX parser.
        
            Creates the first parser it is able to instantiate of the ones
            given in the list created by doing parser_list +
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/sax/__init__.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 isinstance(v, QName):
                                v = qnames[v.text]
                            else:
                                v = _escape_attrib_html(v, encoding)
                            # FIXME: handle boolean attributes
        Severity: Major
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/etree/ElementTree.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if isinstance(v, QName):
                                  v = qnames[v.text]
                              else:
                                  v = _escape_attrib(v, encoding)
                              write(" %s=\"%s\"" % (qnames[k], v))
          Severity: Major
          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/etree/ElementTree.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 AppPkg/Applications/Python/Python-2.7.2/Lib/unittest/runner.py - About 45 mins to fix

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

                  def write(self, file_or_filename,
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/etree/ElementTree.py - About 45 mins to fix

                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 AppPkg/Applications/Python/Python-2.7.2/Lib/xml/dom/minidom.py - About 45 mins to fix

                  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 AppPkg/Applications/Python/Python-2.7.2/Lib/xml/dom/minidom.py - About 45 mins to fix

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

                        def expandNode(self, node):
                            event = self.getEvent()
                            parents = [node]
                            while event:
                                token, cur_node = event
                    Severity: Minor
                    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/dom/pulldom.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 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 AppPkg/Applications/Python/Python-2.7.2/Lib/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

                    Avoid deeply nested control flow statements.
                    Open

                                            if attr.value == id:
                                                result = node
                                            elif node._magic_id_nodes == 1:
                                                break
                                elif node._magic_id_nodes:
                    Severity: Major
                    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/dom/minidom.py - About 45 mins to fix

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

                      def prepare_input_source(source, base = ""):
                          """This function takes an InputSource and an optional base URL and
                          returns a fully resolved InputSource object ready for reading."""
                      
                          if type(source) in _StringTypes:
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/sax/saxutils.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 not data:
                                                      break
                                                  buffers.append(data)
                      Severity: Major
                      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/socket.py - About 45 mins to fix

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

                            def load_module(self, name, stuff):
                                file, filename, info = stuff
                                (suff, mode, type) = info
                                try:
                                    if type == BUILTIN_MODULE:
                        Severity: Minor
                        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/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 _readmark has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _readmark(self, chunk):
                                nmarkers = _read_short(chunk)
                                # Some files appear to contain invalid counts.
                                # Cope with this by testing for EOF.
                                try:
                        Severity: Minor
                        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/aifc.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_302 has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def http_error_302(self, url, fp, errcode, errmsg, headers, data=None):
                        Severity: Minor
                        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/urllib.py - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language