hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

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/email/_parseaddr.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 mm.__code__ is None:
                            m.starimports[name] = 1
                    else:
Severity: Major
Found in vector-uefi/fd/efi/StdLib/lib/python.27/modulefinder.py - About 45 mins to fix

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

    def _parseparam(s):
        plist = []
        while s[:1] == ';':
            s = s[1:]
            end = s.find(';')
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/email/message.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 line is NeedMoreData:
                                yield NeedMoreData
                                continue
                            mo = boundaryre.match(line)
    Severity: Major
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/email/feedparser.py - About 45 mins to fix

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

          def set_param(self, param, value, header='Content-Type', requote=True,
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/email/message.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if isinstance(payload, basestring):
                                    mo = NLCRE_eol.search(payload)
                                    if mo:
                                        payload = payload[:-len(mo.group(0))]
                                        self._last.set_payload(payload)
        Severity: Major
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/email/feedparser.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      if v is None: v = True
                                      standard[k] = v
          Severity: Major
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/_LWPCookieJar.py - About 45 mins to fix

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

                def _find_grail_rc(self):
                    import glob
                    import pwd
                    import socket
                    import tempfile
            Severity: Minor
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/webbrowser.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, input_charset=DEFAULT_CHARSET):
                    # RFC 2046, $4.1.2 says charsets are not case sensitive.  We coerce to
                    # unicode because its .lower() is locale insensitive.  If the argument
                    # is already a unicode, we leave it at that, but ensure that the
                    # charset is ASCII, as the standard (RFC XXX) requires.
            Severity: Minor
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/email/charset.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 header_encode has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def header_encode(self, s, convert=False):
                    """Header-encode a string, optionally converting it to output_charset.
            
                    If convert is True, the string will be converted from the input
                    charset to the output charset automatically.  This is not useful for
            Severity: Minor
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/email/charset.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 paderr:
                                    encoded += '==='[:4 - paderr]
                                try:
            Severity: Major
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/email/header.py - About 45 mins to fix

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

              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/heapq.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 find_head_package has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def find_head_package(self, parent, name):
                      self.msgin(4, "find_head_package", parent, name)
                      if '.' in name:
                          i = name.find('.')
                          head = name[:i]
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/modulefinder.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 loads has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None,
                      parse_int=None, parse_constant=None, object_pairs_hook=None, **kw):
                  """Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a JSON
                  document) to a Python object.
              
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/json/__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 this == "]":
                                      if code1[0] is IN:
                                          code1 = code1[1][0]
                                      setappend(code1)
                                      setappend((LITERAL, ord("-")))
              Severity: Major
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/sre_parse.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if s.next in OCTDIGITS:
                                        this = this + sget()
                                literal(makechar(int(this[1:], 8) & 0xff))
                Severity: Major
                Found in vector-uefi/fd/efi/StdLib/lib/python.27/sre_parse.py - About 45 mins to fix

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

                  def py_scanstring(s, end, encoding=None, strict=True,
                  Severity: Minor
                  Found in vector-uefi/fd/efi/StdLib/lib/python.27/json/decoder.py - About 45 mins to fix

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

                    def test():
                        import sys
                        if sys.argv[1:]:
                            file = sys.argv[1]
                        else:
                    Severity: Minor
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/StringIO.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 char == "=":
                                            subpatternappend((ASSERT, (dir, p)))
                                        else:
                                            subpatternappend((ASSERT_NOT, (dir, p)))
                                        continue
                    Severity: Major
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/sre_parse.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if (c in OCTDIGITS and this[2] in OCTDIGITS and
                                              s.next in OCTDIGITS):
                                              this = this + sget()
                                              isoctal = True
                                              literal(makechar(int(this[1:], 8) & 0xff))
                      Severity: Major
                      Found in vector-uefi/fd/efi/StdLib/lib/python.27/sre_parse.py - About 45 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language