This repository contains the code used to analyze C++ code for an assignment.
The repository being analyzed was nodejs
- Clone nodejs
cd
to thenodejs
repository- Copy my
static-code-analyzer
files here - Run
git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags > versions
to get all the releases sorted by date into a file called versions. - Run
git for-each-ref --sort='*authordate' --format='%(tag) %(*authordate:iso8601)' refs/tags > nodejs-dates
to get all the releases with the date as well. - Run
analyze.sh versions
which takes the first argument as the file. It will read the file and go through everyline whilegit checkout
to that specific version in thenodejs
repository and runcccc
static code analyzer on it, creating folders inanalyze/%version
for every checkout. - Move all the data to another folder for analyzing (including the
static-code-analyzer
files. - Run
node main.js versions > data.csv
that will parse the XML data from theanalyze
folders into a .csv format - Run
node date.js nodejs-dates > age.csv
that will sort the date by date with the age as well. - Use R to plot graph using
data.csv
andage.csv
TODO:-
- Write the R code for plotting graph
Data obtained is the total of:-
- Number of modules
- Lines of code
- Cyclomatic complexity
- Number of methods
- Number of private methods