/pyorphan

PyOrphan show suggestion of unused code in your python project.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

PyOrphan

PyOrphan suggest unused code in your python project as target to be removed.

Be careful, take in consideration that python is a dynamic language, and this tool can show false positives.

We suggest use pyorphan as pylint complement.

Installation

  • Clone project:

    git clone git@github.com:estevopaz/pyorphan.git
    
  • System installation (as root):

    cd pyorphan
    ./setup.py install
    

    Note: If you want modify code use:

    ./setup.py develop
    

Usage

usage: pyorphan [-h] project_path [file_path]

Orphan python code checker.

positional arguments:
  project_path  Project path
  file_path     Tarjet file if required

optional arguments:
  -h, --help    show this help message and exit

Notes

This is a little but useful project to imporove code quality.

Any kind of contribution to the project will be welcome.

TODO

  • Prevent false positives for Flask routes:

    @APP.route('/login', methods=('GET', 'POST'))
    
  • Support --except parameter.

  • Look for unused global variables (not supported by pylint).

  • Allow --context like grep.

  • Support for GNU/Linux Debian package.