Skip to content

Instantly share code, notes, and snippets.

@tyrcho
Last active May 18, 2021 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyrcho/b830fc2e2860734379446aad54fcc0be to your computer and use it in GitHub Desktop.
Save tyrcho/b830fc2e2860734379446aad54fcc0be to your computer and use it in GitHub Desktop.
Code Maat (Your Code as a Crime Scene) script
set xdata time
set timefmt "%Y-%m-%d"
set datafile separator ","
set format x "%Y-%m-%d"
set terminal png size 768,768 enhanced truecolor font 'Roboto,9'
set xlabel "Date"
set xlabel "LoC"
set pointsize 0.8
set border 11
set xtics out
set tics front
set key below
plot 'abs-churn.csv' using 1:2 title 'added' smooth bezier, \
'abs-churn.csv' using 1:3 title 'deleted' smooth bezier, \
'abs-churn.csv' using 1:(10*$4) title 'commits (x10)'
#!/bin/bash
git clone https://github.com/adamtornhill/code-maat
cd code-maat
#~/start_transparent_proxy.sh
docker build -t code-maat .
#!/bin/bash
PROJECT=$1
export maat="docker run --rm -v $(pwd):/data -it code-maat -l /data/git.log -c git2"
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
cd $PROJECT
echo git log
git log --all --numstat --date=short --pretty=format:'--%h--%ad--%aN' --no-renames --after=2018-01-31 > git.log
echo git log done
# $maat -h
# $maat -a summary
analysis=( abs-churn age author-churn authors communication coupling entity-churn entity-effort entity-ownership fragmentation identity main-dev main-dev-by-revs messages refactoring-main-dev revisions soc summary )
for a in "${analysis[@]}"
do
echo "running analysis $a"
$maat -a $a > $a.csv
done
gnuplot $script_dir/activity.gpi > act.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment