Skip to main content

A tool to mine software repositories for defect prediction.

Project description

Build Documentation Codecov lgtm pypi-version python-version

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

modified-repository-miner-1.0.8.tar.gz (33.1 kB view details)

Uploaded Source

Built Distribution

modified_repository_miner-1.0.8-py3-none-any.whl (42.0 kB view details)

Uploaded Python 3

File details

Details for the file modified-repository-miner-1.0.8.tar.gz.

File metadata

File hashes

Hashes for modified-repository-miner-1.0.8.tar.gz
Algorithm Hash digest
SHA256 7a682931abb9a0e8277632f7a435140fd2318d75609b2903af1d17bbe5e51877
MD5 c8468a6d6bd1e787818c3496137dd0d0
BLAKE2b-256 a2b978b18a11fb8d902d2b666d2430b76e814e8cbff00ac2249ee56d17623498

See more details on using hashes here.

File details

Details for the file modified_repository_miner-1.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for modified_repository_miner-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 825c5bf3fb54688675c4e2edd0683369c91f9d626e50f47180e8b876a37d8595
MD5 e74407853ca048f9969d1d0ac1933722
BLAKE2b-256 6ca862287b9fa5197dc5e04d69a0997da0607b413ba8f9db7325d73a5cc609ab

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page