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
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
File details
Details for the file modified-repository-miner-1.0.6.tar.gz
.
File metadata
- Download URL: modified-repository-miner-1.0.6.tar.gz
- Upload date:
- Size: 33.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdc6e64d27bfad34fee266d5d1bb15cfdfb01e1edc5f821d4d8a70f7cece6d25 |
|
MD5 | 8be92c978740243f0c2c6657ba27e15a |
|
BLAKE2b-256 | f530fcaa051e3ce422f18164a63cf892b6eb42b49a064ece3e84290b1d8c8fa5 |
File details
Details for the file modified_repository_miner-1.0.6-py3-none-any.whl
.
File metadata
- Download URL: modified_repository_miner-1.0.6-py3-none-any.whl
- Upload date:
- Size: 42.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0b960f99ec0edd92e13c230fe9b0ca8c2f388674e92509a9b2dca82cf4f6fc0 |
|
MD5 | 71dd0a23110afe9779834739e0138c78 |
|
BLAKE2b-256 | 382543022ec901199adb3bb6b12da75e84e5f56355d81b766ed032dc132c0997 |