hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                    if sourcematch("<"):
                        # named group: skip forward to end of name
                        name = ""
                        while 1:
                            char = sourceget()
Severity: Major
Found in vector-uefi/fd/efi/StdLib/lib/python.27/sre_parse.py - About 45 mins to fix

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

        def __init__(self, fp=None, headers=None, outerboundary="",
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/cgi.py - About 45 mins to fix

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

          def get_message(self, key):
              """Return a Message representation or raise a KeyError."""
              start, stop = self._lookup(key)
              self._file.seek(start)
              self._file.readline()   # Skip '1,' line specifying labels.
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/mailbox.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 update has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def update(self, dict=None, **kwargs):
              if dict is None:
                  pass
              elif isinstance(dict, UserDict):
                  self.data.update(dict.data)
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/UserDict.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 set_flags has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def set_flags(self, flags):
              """Set the given flags and unset all others."""
              flags = set(flags)
              status_flags, xstatus_flags = '', ''
              for flag in ('R', 'O'):
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/mailbox.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 update_visible has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def update_visible(self):
              """Update and/or sensibly generate a set of visible headers."""
              for header in self._visible.keys():
                  if header in self:
                      self._visible.replace_header(header, self[header])
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/mailbox.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 encode has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def encode(input, output):
          """Encode a file."""
          while True:
              s = input.read(MAXBINSIZE)
              if not s:
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/base64.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 __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(self, dirname, factory=rfc822.Message, create=True):
              """Initialize a Maildir instance."""
              Mailbox.__init__(self, dirname, factory, create)
              self._paths = {
                  'tmp': os.path.join(self._path, 'tmp'),
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/mailbox.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 __delitem__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def __delitem__(self, name):
              """Delete all occurrences of a specific header, if it is present."""
              name = name.lower()
              if not name in self.dict:
                  return
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/rfc822.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 getrouteaddr has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def getrouteaddr(self):
              """Parse a route address (Return-path value).
      
              This method just skips all the route stuff and returns the addrspec.
              """
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/rfc822.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 getdomain has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def getdomain(self):
              """Get the complete domain name from an address."""
              sdlist = []
              while self.pos < len(self.field):
                  if self.field[self.pos] in self.LWS:
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/rfc822.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 seek has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def seek(self, pos, whence=0):
              if self.closed:
                  raise ValueError("seek on closed file")
              try:
                  pos.__index__
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/_pyio.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 nested has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def nested(*managers):
          """Combine multiple context managers into a single nested context manager.
      
         This function has been deprecated in favour of the multiple manager form
         of the with statement.
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/contextlib.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 getaddrspec has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def getaddrspec(self):
              """Parse an RFC 2822 addr-spec."""
              aslist = []
      
              self.gotonext()
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/rfc822.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 get_string has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_string(self, key):
              """Return a string representation or raise a KeyError."""
              try:
                  if self._locked:
                      f = open(os.path.join(self._path, str(key)), 'r+')
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/mailbox.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 _get_wholeText has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def _get_wholeText(self):
              L = [self.data]
              n = self.previousSibling
              while n is not None:
                  if n.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):
      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 attr.value == id:
                                  result = node
                              elif node._magic_id_nodes == 1:
                                  break
                  elif 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 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 vector-uefi/fd/efi/StdLib/lib/python.27/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 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 vector-uefi/fd/efi/StdLib/lib/python.27/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

        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 vector-uefi/fd/efi/StdLib/lib/python.27/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

        Severity
        Category
        Status
        Source
        Language