A tool to mine software repositories for defect prediction.
Project description
radon-repository-miner
RepositoryMiner is a Python framework that helps developers and researchers to mining software repositories. It currently supports the Infrastructure as Code technology Ansible and Tosca.
How to install
From PyPI:
pip install repository-miner
From source code:
git clone https://github.com/radon-h2020/radon-repository-miner.git
cd radon-repository-miner
pip install -r requirements.txt
pip install .
Important: to properly use the FixingCommitCategorized, install the spaCy statistical model en_core_web_sm
:
python -m spacy download en_core_web_sm
Usage
from repominer.mining.<ansible|tosca> import <Ansible|Tosca>Miner
from repominer.metrics.<ansible|tosca> import <Ansible|Tosca>MetricsExtractor
miner = <Ansible|Tosca>Miner(url_to_repo='github.com/adriagalin/ansible.motd', clone_repo_to='/tmp')
miner.get_fixing_commits()
miner.get_fixed_files()
failure_prone_files = miner.label()
metrics_extractor = <Ansible|Tosca>MetricsExtractor(path_to_repo='/tmp/ansible.motd')
metrics_extractor.extract(failure_prone_files, product=True, process=True, delta=True)
metrics_extractor.to_csv('metrics.csv')
print('FIXING COMMITS:', miner.fixing_commits)
print('FAILURE-PRONE FILES:', failure_prone_files)
print('METRICS:', metrics_extractor.dataset.head())
How to test
pip install pytest
unzip test_data.zip -d .
pytest
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
repository-miner-1.0.4.tar.gz
(32.9 kB
view details)
Built Distribution
File details
Details for the file repository-miner-1.0.4.tar.gz
.
File metadata
- Download URL: repository-miner-1.0.4.tar.gz
- Upload date:
- Size: 32.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4b4b07751ee163c995bdd24a728917d1992559b294ac9174a439e68e467120d |
|
MD5 | 0a3ade44aa299e1ac8f279a41238fcae |
|
BLAKE2b-256 | bbba0fd75b0611ef7cacb500c8daeb3cc4627821979f1efae48140c8344b740e |
File details
Details for the file repository_miner-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: repository_miner-1.0.4-py3-none-any.whl
- Upload date:
- Size: 39.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc8761abb12b4e1decf98b0ff9653ce8017b62b1afb5960497e7031a5b9904bc |
|
MD5 | 4b47d05940fb8a57eeaba360357db581 |
|
BLAKE2b-256 | 7fd44ad4aeac59b6a5df45850bd232b18f6b0f26c160fea52c81eb720adcf702 |