metric calculator for Java projects
for a project:
- cn = 1 - sum(dloc) / sum(sloc)
for each method:
- sloc = source lines of code
- dloc = dloc
- cc = cyclomatic complexity
- (not yet) ncalls - number of calls (including calls via overriding)
sbt "run -s src"
-t
(or--trend
) flag tracks all previous commits and generatetrend.txt
andtrend.html
which show how the cn metric changes.
Each line represents sloc - dloc - cc - name
of a method.
11 8.5 3 method1
8 7 2 method2
...
This project points to two submodules as samples: GitHub's android app, Google's iosched app.
- after initial clone,
git submodule init/update
to retrieve sample projects' source samples/google-iosched
requires 'android-18', 'Google Repository' and 'Build Tool v18.0.1'. To build./gradlew asDe
samples/github-android
requires 'android-16'. To buildmvn package
- In
samples
directory, runscala run_samples.scala
to runmetr
on all samples. samples/github-android-output
containstrend
ofcn
andsloc
sbt update
will retrieve managed dependencies.sbt eclipse
will generate/update eclipse project setting.sbt assembly
to make a one jar executable
- add C++/C support