Skip to content
/ pydups Public

Static analysis tool to search for code duplication in your python codebase.

License

Notifications You must be signed in to change notification settings

glumia/pydups

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Search for code duplication in your python codebase inspecting its abstract syntax tree.


This project is in a very early phase, expect bugs and/or sub-optimal behaviour.

Feedbacks, issues, pull requests are welcome!

Requirements

Usage

usage: pydups.py [-h] path

Search for duplicate functions looking at code's AST.

positional arguments:
  path        path of the python module to inspect

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

Examples:

$ python3 pydups.py tests/pyfoo
Found duplicates 💥

================================================================================

def f(x0, x1):
    x0 += 3
    x1 = (x1 + 1)
    return (x0 + x1)

tests/pyfoo/foo.py::foo
tests/pyfoo/boo/boo.py::boo

================================================================================

def f(x0, x1, x2):
    return (x1 * x2)

tests/pyfoo/foo.py::FooClass.coo
tests/pyfoo/foo.py::GooClass.doo
tests/pyfoo/boo/boo.py::HooClass.hoo

$ python3 pydups.py pydups.py 
No duplicates! ✨

About

Static analysis tool to search for code duplication in your python codebase.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages