Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
feat(#7): metrics.sh, metrics.py, install reqs
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed Jun 6, 2024
1 parent 5c1448e commit dce3839
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
1 change: 1 addition & 0 deletions steps/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
set -e

npm install -g ghminer@0.0.3
pip3 install -r requirements.txt
echo "All dependencies are installed and up to date! Now you can run 'make' and build the dataset."
30 changes: 26 additions & 4 deletions steps/structure.sh → steps/metrics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env bash
# The MIT License (MIT)
#
# Copyright (c) 2024 Aliaksei Bialiauski
Expand All @@ -20,7 +19,30 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import pandas as pd

set -e
set -o pipefail

frame = pd.read_csv('results.csv')
frame["ic"] = frame["issues"] / frame["commits"]
# @todo #7:30min Compute CPD and RC metrics too.
# We need to compute CPD and RC metrics too, however for now we don't have
# the proper dataset after ghminer execution. Need to collect required data
# first, and then compute CPDs and RCs. Don't forget to remove this puzzle.
frame.drop(
columns=[
"branch",
"createdAt",
"lastCommitDate",
"lastReleaseDate",
"contributors",
"pulls",
"commits",
"issues",
"forks",
"stars",
"license",
"language",
"diskUsage"
],
inplace=True
)
frame.to_csv("repos.csv", index=False)
3 changes: 2 additions & 1 deletion steps/metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
set -e
set -o pipefail

# CPD, RC, IC
# Compute CPD, RC, IC metrics.
python3 metrics.py
1 change: 1 addition & 0 deletions steps/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pandas==2.2.2

0 comments on commit dce3839

Please sign in to comment.