7.1.1.vulture

  • 1.Introduction

    • Vulture is a tool to find unused code, dead code in Python program

      • 1.It's useful for cleaning up and finding errors in large code bases.

      • 2.Find untested code on library and test suite.

    • How does it work?

      • Vulture uses the ast module to build abstract syntax trees for all given files

      • While traversing all syntax trees it records the names of defined and used objects

  • 2.Installation

      $ pip install vulture  # from PyPI
  • 3.Getting Started

    • For single file:

        $ vulture myscript.py
        $ vulture myscript.py --min-confidence 100  # Only report 100% dead code.
    • For large project:

        $ vulture myscript.py mypackage/

Last updated