Skip to content

Description: Static analysis of code quality in open-source Python projects using Radon, Pylint, Flake8, and Bandit.

Notifications You must be signed in to change notification settings

BashirAdam/Static-Analysis-Python-CodeQuality

Repository files navigation

Static Analysis of Code Quality in Open-Source Python Projects

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


πŸ“– Overview

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.


πŸ”§ Tools Used

  • 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

πŸ“Š Workflow

  1. Project Selection – Open-source Python projects (e.g., Requests, BeautifulSoup4).
  2. Metric Extraction – Run Radon, Pylint, Flake8, and Bandit on each source file.
  3. Dataset Creation – Export metrics into a CSV file.
  4. Analysis – Summarize metrics, detect high-risk modules, and visualize trends.


πŸ“ˆ Example Results

  • 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

πŸ›  Installation

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

About

Description: Static analysis of code quality in open-source Python projects using Radon, Pylint, Flake8, and Bandit.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages