jarvisteach/appJar

View on GitHub
appJar/lib/TkDND_wrapper.py

Summary

Maintainability
A
1 hr
Test Coverage

Function drag has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def drag(self, window, actions=None, descriptions=None,
Severity: Minor
Found in appJar/lib/TkDND_wrapper.py - About 35 mins to fix

    Function bindtarget has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def bindtarget(self, window, callback, dndtype, event='<Drop>', priority=50):
    Severity: Minor
    Found in appJar/lib/TkDND_wrapper.py - About 35 mins to fix

      Continuation line under-indented for visual indent
      Open

                  cursorwin=None, callback=None):
      Severity: Minor
      Found in appJar/lib/TkDND_wrapper.py by pep8

      Continuation lines indentation.

      Continuation lines should align wrapped elements either vertically
      using Python's implicit line joining inside parentheses, brackets
      and braces, or using a hanging indent.
      
      When using a hanging indent these considerations should be applied:
      - there should be no arguments on the first line, and
      - further indentation should be used to clearly distinguish itself
        as a continuation line.
      
      Okay: a = (\n)
      E123: a = (\n    )
      
      Okay: a = (\n    42)
      E121: a = (\n   42)
      E122: a = (\n42)
      E123: a = (\n    42\n    )
      E124: a = (24,\n     42\n)
      E125: if (\n    b):\n    pass
      E126: a = (\n        42)
      E127: a = (24,\n      42)
      E128: a = (24,\n    42)
      E129: if (a or\n    b):\n    pass
      E131: a = (\n    42\n 24)

      At least two spaces before inline comment
      Open

              event.mouse_button = b # Mouse button pressed during the drag and drop.
      Severity: Minor
      Found in appJar/lib/TkDND_wrapper.py by pep8

      Separate inline comments by at least two spaces.

      An inline comment is a comment on the same line as a statement.
      Inline comments should be separated by at least two spaces from the
      statement. They should start with a # and a single space.
      
      Each line of a block comment starts with a # and a single space
      (unless it is indented text inside the comment).
      
      Okay: x = x + 1  # Increment x
      Okay: x = x + 1    # Increment x
      Okay: # Block comment
      E261: x = x + 1 # Increment x
      E262: x = x + 1  #Increment x
      E262: x = x + 1  #  Increment x
      E265: #Block comment
      E266: ### Block comment

      Do not use bare 'except'
      Open

      except: import Tkinter as tkinter
      Severity: Minor
      Found in appJar/lib/TkDND_wrapper.py by pep8

      When catching exceptions, mention specific exceptions when possible.

      Okay: except Exception:
      Okay: except BaseException:
      E722: except:

      Expected 2 blank lines, found 1
      Open

      def _load_tkdnd(master):
      Severity: Minor
      Found in appJar/lib/TkDND_wrapper.py by pep8

      Separate top-level function and class definitions with two blank lines.

      Method definitions inside a class are separated by a single blank
      line.
      
      Extra blank lines may be used (sparingly) to separate groups of
      related functions.  Blank lines may be omitted between a bunch of
      related one-liners (e.g. a set of dummy implementations).
      
      Use blank lines in functions, sparingly, to indicate logical
      sections.
      
      Okay: def a():\n    pass\n\n\ndef b():\n    pass
      Okay: def a():\n    pass\n\n\nasync def b():\n    pass
      Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
      Okay: default = 1\nfoo = 1
      Okay: classify = 1\nfoo = 1
      
      E301: class Foo:\n    b = 0\n    def bar():\n        pass
      E302: def a():\n    pass\n\ndef b(n):\n    pass
      E302: def a():\n    pass\n\nasync def b(n):\n    pass
      E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
      E303: def a():\n\n\n\n    pass
      E304: @decorator\n\ndef a():\n    pass
      E305: def a():\n    pass\na()
      E306: def a():\n    def b():\n        pass\n    def c():\n        pass

      Continuation line under-indented for visual indent
      Open

                  '%W', '%X', '%Y', '%x', '%y')
      Severity: Minor
      Found in appJar/lib/TkDND_wrapper.py by pep8

      Continuation lines indentation.

      Continuation lines should align wrapped elements either vertically
      using Python's implicit line joining inside parentheses, brackets
      and braces, or using a hanging indent.
      
      When using a hanging indent these considerations should be applied:
      - there should be no arguments on the first line, and
      - further indentation should be used to clearly distinguish itself
        as a continuation line.
      
      Okay: a = (\n)
      E123: a = (\n    )
      
      Okay: a = (\n    42)
      E121: a = (\n   42)
      E122: a = (\n42)
      E123: a = (\n    42\n    )
      E124: a = (24,\n     42\n)
      E125: if (\n    b):\n    pass
      E126: a = (\n        42)
      E127: a = (24,\n      42)
      E128: a = (24,\n    42)
      E129: if (a or\n    b):\n    pass
      E131: a = (\n    42\n 24)

      Multiple statements on one line (colon)
      Open

      try: import tkinter
      Severity: Minor
      Found in appJar/lib/TkDND_wrapper.py by pep8

      Compound statements (on the same line) are generally discouraged.

      While sometimes it's okay to put an if/for/while with a small body
      on the same line, never do this for multi-clause statements.
      Also avoid folding such long lines!
      
      Always use a def statement instead of an assignment statement that
      binds a lambda expression directly to a name.
      
      Okay: if foo == 'blah':\n    do_blah_thing()
      Okay: do_one()
      Okay: do_two()
      Okay: do_three()
      
      E701: if foo == 'blah': do_blah_thing()
      E701: for x in lst: total += x
      E701: while t < 10: t = delay()
      E701: if foo == 'blah': do_blah_thing()
      E701: else: do_non_blah_thing()
      E701: try: something()
      E701: finally: cleanup()
      E701: if foo == 'blah': one(); two(); three()
      E702: do_one(); do_two(); do_three()
      E703: do_four();  # useless semicolon
      E704: def f(x): return 2*x
      E731: f = lambda x: 2*x

      Multiple statements on one line (colon)
      Open

      except: import Tkinter as tkinter
      Severity: Minor
      Found in appJar/lib/TkDND_wrapper.py by pep8

      Compound statements (on the same line) are generally discouraged.

      While sometimes it's okay to put an if/for/while with a small body
      on the same line, never do this for multi-clause statements.
      Also avoid folding such long lines!
      
      Always use a def statement instead of an assignment statement that
      binds a lambda expression directly to a name.
      
      Okay: if foo == 'blah':\n    do_blah_thing()
      Okay: do_one()
      Okay: do_two()
      Okay: do_three()
      
      E701: if foo == 'blah': do_blah_thing()
      E701: for x in lst: total += x
      E701: while t < 10: t = delay()
      E701: if foo == 'blah': do_blah_thing()
      E701: else: do_non_blah_thing()
      E701: try: something()
      E701: finally: cleanup()
      E701: if foo == 'blah': one(); two(); three()
      E702: do_one(); do_two(); do_three()
      E703: do_four();  # useless semicolon
      E704: def f(x): return 2*x
      E731: f = lambda x: 2*x

      Expected 2 blank lines, found 1
      Open

      class TkDND(object):
      Severity: Minor
      Found in appJar/lib/TkDND_wrapper.py by pep8

      Separate top-level function and class definitions with two blank lines.

      Method definitions inside a class are separated by a single blank
      line.
      
      Extra blank lines may be used (sparingly) to separate groups of
      related functions.  Blank lines may be omitted between a bunch of
      related one-liners (e.g. a set of dummy implementations).
      
      Use blank lines in functions, sparingly, to indicate logical
      sections.
      
      Okay: def a():\n    pass\n\n\ndef b():\n    pass
      Okay: def a():\n    pass\n\n\nasync def b():\n    pass
      Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
      Okay: default = 1\nfoo = 1
      Okay: classify = 1\nfoo = 1
      
      E301: class Foo:\n    b = 0\n    def bar():\n        pass
      E302: def a():\n    pass\n\ndef b(n):\n    pass
      E302: def a():\n    pass\n\nasync def b(n):\n    pass
      E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
      E303: def a():\n\n\n\n    pass
      E304: @decorator\n\ndef a():\n    pass
      E305: def a():\n    pass\na()
      E306: def a():\n    def b():\n        pass\n    def c():\n        pass

      Continuation line under-indented for visual indent
      Open

                      cursorwin, cmd)
      Severity: Minor
      Found in appJar/lib/TkDND_wrapper.py by pep8

      Continuation lines indentation.

      Continuation lines should align wrapped elements either vertically
      using Python's implicit line joining inside parentheses, brackets
      and braces, or using a hanging indent.
      
      When using a hanging indent these considerations should be applied:
      - there should be no arguments on the first line, and
      - further indentation should be used to clearly distinguish itself
        as a continuation line.
      
      Okay: a = (\n)
      E123: a = (\n    )
      
      Okay: a = (\n    42)
      E121: a = (\n   42)
      E122: a = (\n42)
      E123: a = (\n    42\n    )
      E124: a = (24,\n     42\n)
      E125: if (\n    b):\n    pass
      E126: a = (\n        42)
      E127: a = (24,\n      42)
      E128: a = (24,\n    42)
      E129: if (a or\n    b):\n    pass
      E131: a = (\n    42\n 24)

      Too many blank lines (2)
      Open

          _subst_format = ('%A', '%a', '%b', '%D', '%d', '%m', '%T',
      Severity: Minor
      Found in appJar/lib/TkDND_wrapper.py by pep8

      Separate top-level function and class definitions with two blank lines.

      Method definitions inside a class are separated by a single blank
      line.
      
      Extra blank lines may be used (sparingly) to separate groups of
      related functions.  Blank lines may be omitted between a bunch of
      related one-liners (e.g. a set of dummy implementations).
      
      Use blank lines in functions, sparingly, to indicate logical
      sections.
      
      Okay: def a():\n    pass\n\n\ndef b():\n    pass
      Okay: def a():\n    pass\n\n\nasync def b():\n    pass
      Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
      Okay: default = 1\nfoo = 1
      Okay: classify = 1\nfoo = 1
      
      E301: class Foo:\n    b = 0\n    def bar():\n        pass
      E302: def a():\n    pass\n\ndef b(n):\n    pass
      E302: def a():\n    pass\n\nasync def b(n):\n    pass
      E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
      E303: def a():\n\n\n\n    pass
      E304: @decorator\n\ndef a():\n    pass
      E305: def a():\n    pass\na()
      E306: def a():\n    def b():\n        pass\n    def c():\n        pass

      There are no issues that match your filters.

      Category
      Status