ReDeBug Source Code.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Unpatched code clone detection tool - reimplemented version in Python.

Please refer to our IEEE S&P research paper and USENIX ;login: article for technical details.

Note that this is a reimplemented version in Python for usability and adaptability, and different from the original faster C implementation used in IEEE S&P evaluation.


  • bitarray, python-magic, and argparse modules: pip install bitarray python-magic argparse
  • libmagic package: apt-get install libmagic-dev on Ubuntu/Debian, brew install libmagic on OSX


Please refer to the help message for options:

$ python -h
usage: [-h] [-n NUM] [-c NUM] [-v] patch_path source_path

positional arguments:
  patch_path            path to patch files (in unified diff format)
  source_path           path to source files

optional arguments:
  -h, --help            show this help message and exit
  -n NUM, --ngram NUM   use n-gram of NUM lines (default: 4)
  -c NUM, --context NUM
                        print NUM lines of context (default: 10)
  -v, --verbose         enable verbose mode (default: False)