SSL Metrics - Git History (LOC/KLOC) Analysis
Project description
SSL Metrics git
Commit LOC Extractor
This is a proof of concept demonstrating that it is possible to use
git
to extract various Lines of Code (LOC) data from a repository and graph various metrics from it
About
This is a proof of concept demonstrating that it is possible to use git
to extract various Lines of Code (LOC) data from a repository and graph various metrics from it.
This software extracts LOC, Delta LOC, and KLOC (LOC / 1000) for every commit within a singular branch of a local git
repository and stores it within a .json
file.
This file can then be piped into a bundled graphing utility to graph the following for LOC, Delta LOC, and KLOC:
- Actual data
- Trend line
- Velocity of trend line
- Acceleration of trend line
The graphs can be saved as a .png
, .pdf
, or any compatible format that matplotlib
supports.
How to Run
Installation
From pip
- Install
Python 3.9.6 +
- (Recommended) Create a virtual environment with
python3.9 -m venv env
and activate it - Run
pip install ssl-metrics-git-commits-loc
- Generate a JSON data set with
ssl-metrics-git-commits-loc-extract -d DIRECTORY -b BRANCH -o FILENAME.json
- Generate graphs with
ssl-metrics-git-commits-loc-graph -i FILENAME.json -l LOC_GRAPH_FILENAME.* -d DELTA_LOC_GRAPH_FILENAME.* -k K_LOC_GRAPH_FILENAME.* -m ESTIMATED_POLYNOMIAL_DEGREE -r REPOSITORY_NAME
Command Line Arguments
ssl-metrics-git-commits-loc-extract
-h
,--help
: Shows the help menu and exits-d
,--directory
: Directory where the.git
folder is located-b
,--branch
: Git branch to analyze-o
,--output
: Output analysis to JSON file
ssl-metrics-git-commits-loc-graph
-h
,--help
: Shows the help menu and exits-i
,--input
: The input data file that will be read to create the graphs-l
,--graph-loc-filename
: The filename to output the LOC graph to-d
,--graph-delta-loc-filename
: The filename to output the Delta LOC graph to-k
,--graph-k-loc-filename
: The filename to output the K LOC graph to-m
,--maximum-degree-polynomial
: Estimated maximum degree of polynomial-r
,--repository-name
: Name of the repository that is being analyzed--x-window-min
: The smallest x value that will be plotted--x-window-max
: The largest x value that will be plotted
Example Outputs
All outputs were generated using the data from examples/json/ssl-metrics-git-commits-loc.json
and with the following command:
python ssl-metrics-git-commits-loc/create_graph.py -i ../examples/json/ssl-metrics-git-commits-loc.json -o out.png -r SoftwareSystemsLaboratory/ssl-metrics-git-commits-loc --*DATA* --graph-all
Where --*DATA*
is either:
loc
dloc
kloc
Lines of Code (LOC) on 1/4/2022
Delta Lines of Code (DLOC) on 1/4/2022
Thousands of Lines of Code (KLOC) on 1/4/2022
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ssl-metrics-git-commits-loc-0.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cec44d066e1d5d852ae0d2a160a34959996935627f676db507f3c72dbb5b19a |
|
MD5 | 4cfb1cf26f5b2be43efa6d4ecea9d8a2 |
|
BLAKE2b-256 | 305de95b340adea56c53dde6b69ebe9d00e85b93526c486c589d00d26b31734c |
Hashes for ssl_metrics_git_commits_loc-0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7cf6ee0736f8250ebd0ccf18c10831f18c488e193e089e51c0dca5313261a27 |
|
MD5 | 2ca6b66317f922f5df3bd1e1931077d8 |
|
BLAKE2b-256 | 5e40ae51b1318a9dcd099f126cc73361f12ad8be9777d207ea26f899a506611b |