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

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 AppPkg/Applications/Python/Python-2.7.2/Lib/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 not mo:
                            self._input.unreadline(line)
                            break
                    # Recurse to parse this subpart; the input stream points
                    # at the subpart's first line.
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/email/feedparser.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if retval is NeedMoreData:
                                yield NeedMoreData
                                continue
                            break
    Severity: Major
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/email/feedparser.py - About 45 mins to fix

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

          def connect_ftp(self, user, passwd, host, port, dirs, timeout):
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/urllib2.py - About 45 mins to fix

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

            def _plain_replace(self, a, alo, ahi, b, blo, bhi):
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/difflib.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if preamble:
                                      # According to RFC 2046, the last newline belongs
                                      # to the boundary.
                                      lastline = preamble[-1]
                                      eolmo = NLCRE_eol.search(lastline)
          Severity: Major
          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/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 AppPkg/Applications/Python/Python-2.7.2/Lib/_LWPCookieJar.py - About 45 mins to fix

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

                  def scan_opcodes(self, co,
                                   unpack = struct.unpack):
                      # Scan the code, and yield 'interesting' opcode combinations
                      # Version for Python 2.4 and older
                      code = co.co_code
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/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

              Avoid deeply nested control flow statements.
              Open

                                  if paderr:
                                      encoded += '==='[:4 - paderr]
                                  try:
              Severity: Major
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/email/header.py - About 45 mins to fix

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

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

                def py_encode_basestring_ascii(s):
                    """Return an ASCII-only JSON representation of a Python string
                
                    """
                    if isinstance(s, str) and HAS_UTF8.search(s) is not None:
                Severity: Minor
                Found in AppPkg/Applications/Python/Python-2.7.2/Lib/json/encoder.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

                                    while 1:
                                        char = sourceget()
                                        if char is None:
                                            raise error, "unterminated name"
                                        if char == ")":
                Severity: Major
                Found in AppPkg/Applications/Python/Python-2.7.2/Lib/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 AppPkg/Applications/Python/Python-2.7.2/Lib/sre_parse.py - About 45 mins to fix

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

                    Avoid deeply nested control flow statements.
                    Open

                                        if this in (None, "\n"):
                                            break
                                    continue
                    Severity: Major
                    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/sre_parse.py - About 45 mins to fix

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

                          def __init__(self, s=None, charset=None,
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/email/header.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if char == "=":
                                                subpatternappend((ASSERT, (dir, p)))
                                            else:
                                                subpatternappend((ASSERT_NOT, (dir, p)))
                                            continue
                        Severity: Major
                        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/sre_parse.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if char is None:
                                                  raise error, "unexpected end of pattern"
                                              if char == ")":
                          Severity: Major
                          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/sre_parse.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if not sourcematch(")"):
                                                    raise error, "unbalanced parenthesis"
                                                continue
                            Severity: Major
                            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/sre_parse.py - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language