This repository contains the datasets, scripts, and figures for the paper:
Static Analysis of Code Quality in Open-Source Python Projects
Submitted to Journal of Undergraduate Research International (JURI), 2025
This project evaluates the code quality of popular open-source Python projects using static analysis metrics.
The goal is to provide empirical insights into maintainability, complexity, coding standard adherence, and security issues.
- Radon β Lines of Code (LOC), Cyclomatic Complexity (CC), Maintainability Index (MI)
- Pylint β Code quality score, code smells
- Flake8 β PEP8 style violations
- Bandit β Security issue detection
- Project Selection β Open-source Python projects (e.g., Requests, BeautifulSoup4).
- Metric Extraction β Run Radon, Pylint, Flake8, and Bandit on each source file.
- Dataset Creation β Export metrics into a CSV file.
- Analysis β Summarize metrics, detect high-risk modules, and visualize trends.
- Average Cyclomatic Complexity: 1.87 across 6,962 files
- Maintainability Index: 45.0 mean (0β100 scale)
- PEP8 Violations: Ranged from 0 to 1,087 per file
- Security Issues: Up to 596 flagged per file
Clone the repository and install dependencies:
git clone https://github.com/YOUR_USERNAME/Static-Analysis-Python-CodeQuality.git
cd Static-Analysis-Python-CodeQuality
pip install pandas radon pylint flake8 bandit tqdm