hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                    if char == "<":
                        if source.next not in LOOKBEHINDASSERTCHARS:
                            raise error, "syntax error"
                        dir = -1 # lookbehind
                        char = sourceget()
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

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

      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 AppPkg/Applications/Python/Python-2.7.2/Lib/_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 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 AppPkg/Applications/Python/Python-2.7.2/Lib/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 not source.next in FLAGS:
                              raise error, "unexpected end of pattern"
                          while source.next in FLAGS:
      Severity: Major
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/sre_parse.py - About 45 mins to fix

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

        Avoid deeply nested control flow statements.
        Open

                            if code1[0] is IN:
                                code1 = code1[1][0]
                            setappend(code1)
        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

                              while source.next in DIGITS:
                                  hi = hi + sourceget()
                          else:
          Severity: Major
          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/sre_parse.py - About 45 mins to fix

            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 AppPkg/Applications/Python/Python-2.7.2/Lib/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 nsmallest has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, message, category, filename, lineno, file=None,
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/warnings.py - About 45 mins to fix

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

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

                  def __init__(self, fp=None, headers=None, outerboundary="",
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/cgi.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if not nl: print
                                        a.dump(level+1); nl = 1
                Severity: Major
                Found in AppPkg/Applications/Python/Python-2.7.2/Lib/sre_parse.py - About 45 mins to fix

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

                  def _show_warning(message, category, filename, lineno, file=None, line=None):
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/warnings.py - About 45 mins to fix

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

                    Avoid deeply nested control flow statements.
                    Open

                                        while 1:
                                            if source.next is None or source.next == ")":
                                                break
                                            sourceget()
                                        if not sourcematch(")"):
                    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 s.next in OCTDIGITS:
                                              this = this + sget()
                                      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
                        Severity
                        Category
                        Status
                        Source
                        Language