[Python-Dev] FW: PyChecker - a python source code bug finder

Tim Peters tim.one@home.com
Sat, 7 Apr 2001 17:27:35 -0400


Way cool!  Check this out.  I picked 4 of the problems Neal found "at
random", and all appear to still exist under current CVS.  How about everyone
take their favorite module and fix it?

Thank you, Neal!

-----Original Message-----
From: python-list-admin@python.org
[mailto:python-list-admin@python.org]On Behalf Of Neal Norwitz
Sent: Saturday, April 07, 2001 2:28 PM
To: python-announce-list@python.org; python-list@python.org
Subject: PyChecker - a python source code bug finder



PyChecker is a python source code checking tool to help you find common bugs.
It is meant to find problems that are typically caught by a compiler. Because
of the dynamic nature of python, some warnings may be incorrect; however,
spurious warnings should be fairly infrequent.

Types of problems that can currently, be found include:

    * No doc strings in modules, classes, functions, and methods
    * self not the first parameter to a method
    * Wrong number of parameters passed to functions/methods
    * No global found (e.g., using a module without importing it)
    * Global not used (module or variable)

PyChecker currently runs on Python 2.0.  If there's interest, it can be back
ported to Python 1.5.2.

I have run PyChecker against Python 2.1b2a, the following are problems found
in the standard python modules:

    ### Warnings
        codeop.py:3 Imported module (sys) not used
        codeop.py:4 Imported module (traceback) not used
        fileinput.py:292 Function (input) doesn't require named arguments
        multifile.py:30 Imported module (sys) not used
        pipes.py:62 Imported module (sys) not used
        urllib.py:598 Function (quote) doesn't require named arguments
        urllib.py:611 Function (quote) doesn't require named arguments
        string.py:190 Variable (_StringType) not used
        tabnanny.py:15 Imported module (string) not used
                        imported again @ 241 and used there

    ### Errors:
        audiodev.py:214 No global (BUFFERSIZE) found
        bdb.py:111 No method (do_clear) found
        chunk.py:109 No attribute (chunk_size) found
			should be chunksize
        locale.py:253 No global (l) found
        netrc.py:13 No global (file) found
        pydoc.py:1070 No global (DocImportError) found
        pydoc.py:1070 No global (filename) found


PyChecker is available on Source Forge:
    web page:		http://pychecker.sourceforge.net/
    project page:	http://sourceforge.net/projects/pychecker/

Enjoy!  Feedback is greatly appreciated.

Neal
--
pychecker@metaslash.com

--
http://mail.python.org/mailman/listinfo/python-list