Last active
May 18, 2021 07:10
-
-
Save tyrcho/b830fc2e2860734379446aad54fcc0be to your computer and use it in GitHub Desktop.
Code Maat (Your Code as a Crime Scene) script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git clone https://github.com/adamtornhill/code-maat | |
cd code-maat | |
#~/start_transparent_proxy.sh | |
docker build -t code-maat . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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