Software maintainability becomes difficult when object-oriented systems contain God Class code smells, where a single class handles excessive responsibilities and controls large portions of system behavior. Most existing God Class detection approaches use metric thresholds developed for statically typed languages such as Java, which may not accurately represent the architectural characteristics of dynamically typed PHP systems. This problem can reduce software maintainability, increase system complexity, and complicate future development and testing activities. This study applies a quantitative empirical research approach to evaluate metric-based God Class detection in PHP systems. Twelve open-source PHP projects containing 7,866 classes were collected from GitHub and analyzed using the PDepend static analysis tool. The extracted object-oriented metrics included Weighted Methods per Class (WMC), Number of Public Methods (NPM), Depth of Inheritance Tree (DIT), and Lines of Code (LOC). A class was classified as a God Class when at least three out of four threshold values were exceeded. The detection results were validated using statistical analysis, K-Means clustering, machine learning consistency validation, PHPMD comparison, and expert manual validation. The results identified 421 God Classes and showed that WMC, NPM, and LOC are strong indicators of God Class behavior in PHP systems, while DIT has lower influence due to framework-based inheritance structures. The study demonstrates that metric-based detection can effectively identify maintainability problems in PHP applications and provides a foundation for future PHP-specific threshold development.
Copyrights © 2026