File pychecker.1 of Package pychecker

.TH PYCHECKER 1 "March 21, 2003" "" ""
.SH NAME
\fBpychecker \fP- program to check python scripts for common mistakes
.SH SYNOPSIS
.nf
.fam C
\fBpychecker\fP [\fIoptions\fP] files\.\.\.
.fam T
.fi
.SH DESCRIPTION
This manual page documents briefly the \fBpychecker\fP command. It was written
for the Debian GNU/Linux distribution because the original program does not
have a manual page.
.PP
\fBpychecker\fP is a program that finds common bugs in python
source code. It finds problems that are typically caught by a compiler for
less dynamic languages, like C and C++. Because of the dynamic nature of
python, some warnings may be incorrect; however, spurious warnings should be
fairly infrequent.
.PP
\fBpychecker\fP works in a combination of ways.
First, it imports each module. If there is an import error, the module
cannot be processed. The import provides some basic information about the module.
The code for each function, class, and method is checked for possible
problems.
.SH OPTIONS
Long \fIoptions\fP can be preceded with no- to turn off (e.g., no-namedargs)
.PP
Major Options:
.TP
.B
\fB-e\fP, \fB--errors\fP
turn off all warnings which are not likely errors
.TP
.B
\fB--complexity\fP
turn off all warnings which are related to complexity
.TP
.B
\fB-F\fP, \fB--config\fP
specify .pycheckrc file to use
.PP
Error Control:
.TP
.B
\fB-i\fP, \fB--import\fP
unused imports [on]
-k, \fB--pkgimport\fP unused imports from __init__.py [on]
\fB-M\fP, \fB--reimportself\fP module imports itself [on]
.TP
.B
\fB-X\fP, \fB--reimport\fP
reimporting a module [on]
.TP
.B
\fB-x\fP, \fB--miximport\fP
module does import and from \.\.\. import [on]
.TP
.B
\fB-l\fP, \fB--local\fP
unused local variables, except tuples [on]
.TP
.B
\fB-t\fP, \fB--tuple\fP
all unused local variables, including tuples [off]
.TP
.B
\fB-9\fP, \fB--members\fP
all unused class data members [off]
.TP
.B
\fB-v\fP, \fB--var\fP
all unused module variables [off]
.TP
.B
\fB-p\fP, \fB--privatevar\fP
unused private module variables [on]
.TP
.B
\fB-g\fP, \fB--allglobals\fP
report each occurrence of global warnings [off]
.TP
.B
\fB-n\fP, \fB--namedargs\fP
functions called with named arguments (like keywords) [on]
.TP
.B
\fB-a\fP, \fB--initattr\fP
Attributes (members) must be defined in \fB__init__\fP() [off]
-I, \fB--initsubclass\fP \fBSubclass.__init__\fP() not defined [off]
-u, \fB--callinit\fP \fBBaseclass.__init__\fP() not called [on]
.TP
.B
\fB-0\fP, \fB--abstract\fP
Subclass needs to override methods that only throw exceptions [on]
.TP
.B
\fB-N\fP, \fB--initreturn\fP
Return None from \fB__init__\fP() [on]
.TP
.B
\fB-8\fP, \fB--unreachable\fP
unreachable code [off]
.TP
.B
\fB-2\fP, \fB--constCond\fP
a constant is used in a conditional statement [on]
.TP
.B
\fB-1\fP, \fB--constant1\fP
1 is used in a conditional statement (if 1: or while 1:) [off]
.TP
.B
\fB--stringiter\fP
check if iterating over a string [on]
.TP
.B
\fB-A\fP, \fB--callattr\fP
Calling data members as functions [off]
.TP
.B
\fB-y\fP, \fB--classattr\fP
class attribute does not exist [on]
.TP
.B
\fB-S\fP, \fB--self\fP
First argument to methods [self]
.TP
.B
\fB-T\fP, \fB--argsused\fP
unused method/function arguments [on]
.TP
.B
\fB-z\fP, \fB--varargsused\fP
unused method/function variable arguments [on]
.TP
.B
\fB-G\fP, \fB--selfused\fP
ignore if self is unused in methods [off]
.TP
.B
\fB-o\fP, \fB--override\fP
check if overridden methods have the same signature [on]
.TP
.B
\fB-U\fP, \fB--reuseattr\fP
check if function/class/method names are reused [on]
.TP
.B
\fB-Y\fP, \fB--positive\fP
check if using unary positive (+) which is usually meaningless [on]
.TP
.B
\fB-j\fP, \fB--moddefvalue\fP
check if modify (call method) on a parameter that has a default value [on]
.TP
.B
\fB--changetypes\fP
check if variables are set to different types [off]
.TP
.B
\fB--unpack\fP
check if unpacking a non-sequence [on]
.TP
.B
\fB--unpacklen\fP
check if unpacking sequence with the wrong length [on]
.TP
.B
\fB--badexcept\fP
check if raising or catching bad exceptions [on]
.TP
.B
\fB-4\fP, \fB--noeffect\fP
check if statement appears to have no effect [on]
.TP
.B
\fB--modulo1\fP
check if using (expr % 1), it has no effect on integers and strings [on]
.TP
.B
\fB--isliteral\fP
check if using (expr is const-literal), doesn't always
work on integers and strings [on]
.PP
Possible Errors:
.PP
\fB-r\fP, \fB--returnvalues\fP check consistent return values [off]
\fB-C\fP, \fB--implicitreturns\fP check if using implict and explicit return values [on]
.TP
.B
\fB-O\fP, \fB--objattrs\fP
check that attributes of objects exist [on]
.TP
.B
\fB-7\fP, \fB--slots\fP
various warnings about incorrect usage of __slots__ [on]
.TP
.B
\fB-3\fP, \fB--properties\fP
using properties with classic classes [on]
.TP
.B
\fB--emptyslots\fP
check if __slots__ is empty [on]
.TP
.B
\fB-D\fP, \fB--intdivide\fP
check if using integer division [on]
.TP
.B
\fB-w\fP, \fB--shadow\fP
check if local variable shadows a global [on]
.PP
Security:
.TP
.B
\fB--input\fP
check if \fBinput\fP() is used [on]
.TP
.B
\fB-6\fP, \fB--exec\fP
check if the exec statement is used [off]
.PP
Suppressions:
.TP
.B
\fB-q\fP, \fB--stdlib\fP
ignore warnings from files under standard library [off]
.TP
.B
\fB-b\fP, \fB--blacklist\fP
ignore warnings from the list of modules
[['Tkinter', 'wxPython', 'gtk', 'GTK', 'GDK']]
.TP
.B
\fB-Z\fP, \fB--varlist\fP
ignore global variables not used if name is one of these values
[['__all__', '__version__', '__copyright__']]
.TP
.B
\fB-E\fP, \fB--unusednames\fP
ignore unused locals/arguments if name is one of these values
[['_', 'empty', 'unused', 'dummy']]
.RS
.TP
.B
\fB--deprecated\fP
ignore use of deprecated modules/functions [on]
.RE
.PP
Complexity:
.TP
.B
\fB-L\fP, \fB--maxlines\fP
maximum lines in a function [200]
.TP
.B
\fB-B\fP, \fB--maxbranches\fP
maximum branches in a function [50]
.TP
.B
\fB-R\fP, \fB--maxreturns\fP
maximum returns in a function [10]
.TP
.B
\fB-J\fP, \fB--maxargs\fP
maximum # of arguments to a function [10]
.TP
.B
\fB-K\fP, \fB--maxlocals\fP
maximum # of locals in a function [40]
.TP
.B
\fB-5\fP, \fB--maxrefs\fP
maximum # of identifier references (Law of Demeter) [5]
.TP
.B
\fB-m\fP, \fB--moduledoc\fP
no module doc strings [on]
.TP
.B
\fB-c\fP, \fB--classdoc\fP
no class doc strings [on]
.TP
.B
\fB-f\fP, \fB--funcdoc\fP
no function/method doc strings [off]
.PP
Debug:
.TP
.B
\fB--rcfile\fP
print a .pycheckrc file generated from command line args
.TP
.B
\fB-P\fP, \fB--printparse\fP
print internal checker parse structures [off]
.TP
.B
\fB-d\fP, \fB--debug\fP
turn on debugging for checker [off]
.TP
.B
\fB-Q\fP, \fB--quiet\fP
turn off all output except warnings
.TP
.B
\fB-V\fP, \fB--version\fP
print the version of PyChecker and exit
.SH SEE ALSO
\fBpython\fP(1)
.SH AUTHOR
This manual page was written by Fredrik Steen <stone@debian.org> for
the Debian GNU/Linux system (but may be used by others).