--- loncom/build/Makefile.cvs 2002/01/07 22:12:59 1.1
+++ loncom/build/Makefile.cvs 2002/02/11 06:28:11 1.3
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Scott Harrison
-# $Id: Makefile.cvs,v 1.1 2002/01/07 22:12:59 harris41 Exp $
+# $Id: Makefile.cvs,v 1.3 2002/02/11 06:28:11 harris41 Exp $
STATDIR="loncom/build/cvsstats"
STATSUBDIR="cvsstats"
@@ -63,27 +63,33 @@ cvsreport:
echo "
" >> ../../doc/build/cvsreport.html
statpage:
- install -d cvsstats
+ install -d $(STATSUBDIR)
echo 'LON-CAPA Coding Metrics' > $(STATSUBDIR)/index.html
echo '' >> $(STATSUBDIR)/index.html
echo 'LON-CAPA Coding Metrics
' >> $(STATSUBDIR)/index.html
echo '
Compiled as of ' >> $(STATSUBDIR)/index.html
date >> $(STATSUBDIR)/index.html
- echo '
'
- echo '
Lines of Code; unique changes per month' >> $(STATSUBDIR)/index.html
- echo '
Lines of Code; unique changes (*.pm only) per month' >> $(STATSUBDIR)/index.html
- echo '
Lines of Code; aggregating sum of unique changes per month' >> $(STATSUBDIR)/index.html
- echo '
Lines of Code; aggregating sum of unique changes (*.pm only) per month' >> $(STATSUBDIR)/index.html
- echo '
Number of commits to software repository per month' >> $(STATSUBDIR)/index.html
- echo '
Number of commits to software repository (*.pm only) per month' >> $(STATSUBDIR)/index.html
- echo '
Aggregating sum of number of commits to software repository per month' >> $(STATSUBDIR)/index.html
- echo '
Aggregating sum of number of commits to software repository (*.pm only) per month' >> $(STATSUBDIR)/index.html
+ echo "The general algorithm for counting lines of code (this excludes blank lines) is
cvs -q diff -D'start-date' -D'end-date' -b -B -N | egrep '^> .*[^ \t]' | sed 's/^> //g' | sort | uniq | wc -l
" >> $(STATSUBDIR)/index.html
+ echo "The general algorithm for counting the number of CVS repository commits (includes additions, deletions, and modifications) is:
cvs history -D'start-date' -a -xMAR | wc -l
" >> $(STATSUBDIR)/index.html
+ echo "Each listing contains two graphs. One graph relates to the entire LON-CAPA repository. The other graph relates solely to the *.pm files (perl modules including Apache handlers).
" >> $(STATSUBDIR)/index.html
+ echo '
Lines of Code; unique changes per month' >> $(STATSUBDIR)/index.html
+ echo '
Lines of Code; aggregate sum of unique changes per month' >> $(STATSUBDIR)/index.html
+ echo '
Number of commits to software repository per month' >> $(STATSUBDIR)/index.html
+ echo '
Aggregate sum of number of commits to software repository per month' >> $(STATSUBDIR)/index.html
+ echo '
Lines of Code
' >> $(STATSUBDIR)/index.html
+ echo 'The first graph displays the number of unique line changes made in the CVS repository per month. The second graphs displays the number of unique line changes made to *.pm files in the CVS repository per month.' >> $(STATSUBDIR)/index.html
echo '
' >> $(STATSUBDIR)/index.html
echo '
' >> $(STATSUBDIR)/index.html
+ echo '
Aggregate Lines of Code
' >> $(STATSUBDIR)/index.html
+ echo 'The first graph displays the aggregate number of unique line changes made in the CVS repository per month. The second graphs displays the aggregate number of unique line changes made to *.pm files in the CVS repository per month.' >> $(STATSUBDIR)/index.html
echo '
' >> $(STATSUBDIR)/index.html
echo '
' >> $(STATSUBDIR)/index.html
+ echo '
Commits to Repository
' >> $(STATSUBDIR)/index.html
+ echo 'The first graph displays the number of repository commits (additions, deletions, and modifications) made in the CVS repository per month. The second graphs displays the number of repository commits involving *.pm files made in the CVS repository per month.' >> $(STATSUBDIR)/index.html
echo '
' >> $(STATSUBDIR)/index.html
echo '
' >> $(STATSUBDIR)/index.html
+ echo '
Aggregate Commits to Repository
' >> $(STATSUBDIR)/index.html
+ echo 'The first graph displays the aggregate number of repository commits (additions, deletions, and modifications) made in the CVS repository per month. The second graphs displays the aggregate number of repository commits involving *.pm files made in the CVS repository per month.' >> $(STATSUBDIR)/index.html
echo '
' >> $(STATSUBDIR)/index.html
echo '
' >> $(STATSUBDIR)/index.html
echo '' >> $(STATSUBDIR)/index.html
@@ -107,7 +113,7 @@ for ($$y=$$by; $$y<=$$ey; $$y++) {\
}' 20000101 `date +"%Y%m%d"` |\
perl -nle '($$d1,$$d2)=split(/\t/);$$loc=`cvs -q diff -D$$d1 -D$$d2 -b -B -N | egrep \"^> .*[^ \t]\" | sed \"s/^> //g\" | sort | uniq | wc -l`;chomp $$loc;$$locsum+=$$loc;print "$$d2\t$$loc\t$$locsum";' > $(STATDIR)/table.txt
echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code\\nUnique changes per month"\nset output "cvsstats/loc.png"\nset term png color\nplot "cvsstats/table.txt" using 1:2 with lines' | gnuplot
- echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code\\nUnique changes per month"\nset output "cvsstats/locsum.png"\nset term png color\nplot "cvsstats/table.txt" using 1:3 with lines' | gnuplot
+ echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code\\nAggregate count; Unique changes per month"\nset output "cvsstats/locsum.png"\nset term png color\nplot "cvsstats/table.txt" using 1:3 with lines' | gnuplot
cd ../..; perl -e ' \
($$begindate,$$enddate)=@ARGV;\
($$by,$$bm,$$bd)=($$begindate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
@@ -125,14 +131,45 @@ perl -e "\@flag=(1);while(<>){if (/RCS f
egrep \"^> .*[^ \t]\" | sed \"s/^> //g\" | sort | uniq | wc -l`;chomp $$loc;$$locsum+=$$loc;print "$$d2\t$$loc\t$$locsum";' > $(STATDIR)/tablepm.txt
# process counts, generate table
# pass table to gnuplot
- echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code\\nUnique changes per month"\nset output "cvsstats/locpm.png"\nset term png color\nplot "cvsstats/tablepm.txt" using 1:2 with lines' | gnuplot
- echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code\\nUnique changes per month"\nset output "cvsstats/locpmsum.png"\nset term png color\nplot "cvsstats/tablepm.txt" using 1:3 with lines' | gnuplot
+ echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code, perl modules\\nUnique changes per month"\nset output "cvsstats/locpm.png"\nset term png color\nplot "cvsstats/tablepm.txt" using 1:2 with lines' | gnuplot
+ echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code, perl modules\\nAggregate count; Unique changes per month"\nset output "cvsstats/locpmsum.png"\nset term png color\nplot "cvsstats/tablepm.txt" using 1:3 with lines' | gnuplot
cvscommit:
+ install -d cvsstats
# for all, and for .pm
# get date array
- # process counts, generate table
+ cd ../..; perl -e ' \
+($$begindate,$$enddate)=@ARGV;\
+($$by,$$bm,$$bd)=($$begindate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
+($$ey,$$em,$$ed)=($$enddate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
+for ($$y=$$by; $$y<=$$ey; $$y++) {\
+ if ($$y==$$by) {$$m=$$bm;} else {$$m=1;}\
+ if ($$y==$$ey) {$$m2=$$em;} else {$$m2=12;}\
+ for ($$m; $$m<=$$m2; $$m++) {\
+ printf("$$odate\t%4.4d%2.2d%2.2d\n",$$y,$$m,$$bd) if $$odate; \
+ $$odate=sprintf("%4.4d%2.2d%2.2d",$$y,$$m,$$bd);\
+ }\
+}' 20000101 `date +"%Y%m%d"` |\
+perl -nle '($$d1,$$d2)=split(/\t/);$$cmt1=`cvs history -D$$d1 -a -xMAR | wc -l`;chomp $$cmt1;$$cmt2=`cvs history -D$$d2 -a -xMAR | wc -l`;chomp $$cmt2;$$cmt=$$cmt1-$$cmt2;$$cmtsum+=$$cmt;print "$$d2\t$$cmt\t$$cmtsum";' > $(STATDIR)/ctable.txt
+ echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "commits"\nset nokey\nset title "Commits\\n(Additions, Deletions, and Modifications)"\nset output "cvsstats/commit.png"\nset term png color\nplot "cvsstats/ctable.txt" using 1:2 with lines' | gnuplot
+ echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "commits"\nset nokey\nset title "Commits\\nAggregate count (Additions, Deletions, and Modifications"\nset output "cvsstats/commitsum.png"\nset term png color\nplot "cvsstats/ctable.txt" using 1:3 with lines' | gnuplot
+ cd ../..; perl -e ' \
+($$begindate,$$enddate)=@ARGV;\
+($$by,$$bm,$$bd)=($$begindate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
+($$ey,$$em,$$ed)=($$enddate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
+for ($$y=$$by; $$y<=$$ey; $$y++) {\
+ if ($$y==$$by) {$$m=$$bm;} else {$$m=1;}\
+ if ($$y==$$ey) {$$m2=$$em;} else {$$m2=12;}\
+ for ($$m; $$m<=$$m2; $$m++) {\
+ printf("$$odate\t%4.4d%2.2d%2.2d\n",$$y,$$m,$$bd) if $$odate; \
+ $$odate=sprintf("%4.4d%2.2d%2.2d",$$y,$$m,$$bd);\
+ }\
+}' 20000101 `date +"%Y%m%d"` |\
+perl -nle '($$d1,$$d2)=split(/\t/);$$cmt1=`cvs history -D$$d1 -a -xMAR | grep "\.pm[[:space:]]" | wc -l`;chomp $$cmt1;$$cmt2=`cvs history -D$$d2 -a -xMAR | grep "\.pm[[:space:]]" | wc -l`;chomp $$cmt2;$$cmt=$$cmt1-$$cmt2;$$cmtsum+=$$cmt;print "$$d2\t$$cmt\t$$cmtsum";' > $(STATDIR)/ctablepm.txt
+# process counts, generate table
# pass table to gnuplot
+ echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "commits"\nset nokey\nset title "Commits, perl modules\\n(Additions, Deletions, and Modifications)"\nset output "cvsstats/commitpm.png"\nset term png color\nplot "cvsstats/ctablepm.txt" using 1:2 with lines' | gnuplot
+ echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "commits"\nset nokey\nset title "Commits, perl modules\\nAggregate count (Additions, Deletions, and Modifications)"\nset output "cvsstats/commitpmsum.png"\nset term png color\nplot "cvsstats/ctablepm.txt" using 1:3 with lines' | gnuplot
clean:
rm -Rf cvsstats