hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                        if not key in cdict:
                            cdict[key] = cdict[base] = modname + '.html#' + key
        funcs, fdict = [], {}
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pydoc.py - About 45 mins to fix

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

        def bp_commands(self,frame):
            """Call every command that was set for the current active breakpoint
            (if there is one).
    
            Returns True if the normal interaction function must be called,
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pdb.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 docother has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def docother(self, object, name=None, mod=None, parent=None, maxlen=None, doc=None):
            """Produce text documentation for a data object."""
            repr = self.repr(object)
            if maxlen:
                line = (name and name + ' = ' or '') + repr
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pydoc.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 n in d:
                                if n[0] != '_':
                                    dict[n] = d[n]
        except StopIteration:
    Severity: Major
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pyclbr.py - About 45 mins to fix

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

          def getfileinfo(name):
              finfo = FInfo()
              # Quick check for textfile
              fp = open(name)
              data = open(name).read(256)
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/binhex.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 sepLines:
                                  write(',\n%s%s: ' % (' '*indent, rep))
                              else:
                                  write(', %s: ' % rep)
                              self._format(ent, stream, indent + _len(rep) + 2,
      Severity: Major
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pprint.py - About 45 mins to fix

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

            def do_whatis(self, arg):
                try:
                    value = eval(arg, self.curframe.f_globals,
                                    self.curframe_locals)
                except:
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pdb.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 _process_result has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def _process_result(self, result, fqname):
                ispkg, code, values = result
                # did get_code() return an actual module? (rather than a code object)
                is_module = isinstance(code, _ModuleType)
        
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/imputil.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_suffix_importer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def py_suffix_importer(filename, finfo, fqname):
            file = filename[:-3] + _suffix
            t_py = long(finfo[8])
            t_pyc = _timestamp(file)
        
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/imputil.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, files=None, inplace=0, backup="", bufsize=0,
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/fileinput.py - About 45 mins to fix

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

          def pathname2url(p):
              """OS-specific conversion from a file system path to a relative URL
              of the 'file' scheme; not recommended for general use."""
              # e.g.
              # C:\foo\bar\spam.foo
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/nturl2path.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 input has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def input(files=None, inplace=0, backup="", bufsize=0,
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/fileinput.py - About 45 mins to fix

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

            def _module_relative_path(module, path):
                if not inspect.ismodule(module):
                    raise TypeError, 'Expected a module: %r' % module
                if path.startswith('/'):
                    raise ValueError, 'Module-relative files may not have absolute paths'
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/doctest.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 _run_module_code has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def _run_module_code(code, init_globals=None,
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/runpy.py - About 45 mins to fix

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

                  def poll(self, _deadstate=None):
                      """Return the exit status of the child process if it has finished,
                      or -1 if it hasn't finished yet."""
                      if self.sts < 0:
                          try:
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/popen2.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 format_stack_entry has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def format_stack_entry(self, frame_lineno, lprefix=': '):
                      import linecache, repr
                      frame, lineno = frame_lineno
                      filename = self.canonic(frame.f_code.co_filename)
                      s = '%s(%r)' % (filename, lineno)
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/bdb.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 run_docstring_examples has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def run_docstring_examples(f, globs, verbose=False, name="NoName",
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/doctest.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if sepLines:
                                            write(',\n' + ' '*indent)
                                        else:
                                            write(', ')
                                        self._format(ent, stream, indent,
                Severity: Major
                Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pprint.py - About 45 mins to fix

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

                      def trace_dispatch(self, frame, event, arg):
                          if self.quitting:
                              return # None
                          if event == 'line':
                              return self.dispatch_line(frame)
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/bdb.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 docroutine has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def docroutine(self, object, name, mod=None,
                                     funcs={}, classes={}, methods={}, cl=None):
                          """Produce HTML documentation for a function or method object."""
                  
                          anchor = (cl and cl.__name__ or '') + '-' + name
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/DocXMLRPCServer.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