Skip to content

A Python-based implementation of "Your Code as a Crime Scene" by Adam Tornhill

License

Notifications You must be signed in to change notification settings

mattclarke/PyCrimeScene

Repository files navigation

PyCrimeScene

A Python-based implementation of "Your Code as a Crime Scene" by Adam Tornhill.

Generate a git log file

Clone a repo you are interested in and run:

git log --pretty=format:'[%h] %an %ad %s' --date=short --numstat > repo_evo.log

It is also possible to specify date ranges:

git log --pretty=format:'[%h] %an %ad %s' --date=short --numstat --before=2018-10-01 --after=2018-08-01 > repo_evo.log

Run PyCrimeScene

From the PyCrimeScene directory:

python main.py <path to generated log file> <path to local copy of git repo> <name for output files>

For example:

python main.py repo_evo.log /Code/Repos/DMSC/forward-epics-to-kafka/ output

This will produce the files output.csv and output.json.

Displaying the data

Adam Tornhill has a rather nice way of displaying the data using d3; his samples can be downloaded at http://www.adamtornhill.com/code/crimescenetools.htm

If you download that you can replace the data in hibernate/hib_hotspot_proto.json with the JSON generated by PyCrimeScene. Then opening hibzoomable.html will display your data.

For developers

Install the commit hooks (important)

There are commit hooks for Black and Flake8.

The commit hooks are handled using pre-commit.

To install the hooks for this project run:

pre-commit install

To test the hooks run:

pre-commit run --all-files

This command can also be used to run the hooks manually.

About

A Python-based implementation of "Your Code as a Crime Scene" by Adam Tornhill

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published