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.txtandtrend.htmlwhich 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/updateto retrieve sample projects' source samples/google-ioschedrequires 'android-18', 'Google Repository' and 'Build Tool v18.0.1'. To build./gradlew asDesamples/github-androidrequires 'android-16'. To buildmvn package- In
samplesdirectory, runscala run_samples.scalato runmetron all samples. samples/github-android-outputcontainstrendofcnandsloc
sbt updatewill retrieve managed dependencies.sbt eclipsewill generate/update eclipse project setting.sbt assemblyto make a one jar executable
- add C++/C support
