Selected projects
PPCH Framework
Predictive and Proactive Code Health
Final-year dissertation · 2026 · Completed
Grew out of refactoring and SonarQube work during my internship.
- Python
- scikit-learn
- XGBoost
- GitHub REST API
- SonarQube (SonarScanner)
- GitHub Actions
- Java (Apache Commons)
The problem
Code-quality issues are usually found after a pull request merges. Can complexity risk be predicted when a pull request is submitted, and fixed before it merges?
How it works
Sense
Mines PR history through the GitHub REST API and runs SonarScanner on before/after snapshots to build a leakage-safe dataset of 334 PRs.
Analyze
Compares four models with 1,000-iteration bootstrap validation; the best, Logistic Regression, reached 0.78 AUC.
Act
An ILP-based Extract Method engine proposes refactorings behind four safety checks; every applied suggestion was re-verified safe by a real SonarQube scan.
Results
Dataset
- 1,767PRs scraped
- 500sampled
- 497scanned
- 334usable
Model comparison
Mean AUC, 1,000-iteration bootstrap validation Model Mean AUC 95% CI Logistic Regressionbest 0.780 0.709–0.847 XGBoost 0.750 – Random Forest 0.746 – Naive Bayes 0.660 – Act engine
ILP-based Extract Method with four safety checks:
- Return-forwarding
- Break/continue
- Independent-variable mutation
- Non-productive extraction
- 10 suggestions applied, each re-verified safe by a real SonarQube scan
- 4 correctly declined
- 0 unsafe
Deployed GitHub Action
A reactive scanner took a mean 82.4 h (median 12.9 h) to flag complexity-increasing PRs.
The Action caught 22 of 52 (42.3%) before merge.
Screenshots
The PR comment Verified refactoring Across every changed file Install in a few lines Running in GitHub Actions
Limitations
The deployed Action runs Random Forest + XGBoost; Logistic Regression was found best later, in the four-model comparison.




