Overview of Bad Code Smells in Software Development and Researches
Abstract
This study examines the occurrence, influence, and moderation of bad code smells in software development through a hybrid research methodology combining qualitative inspection and quantitative code investigation. Code smells, which are surface level indications of deeper strategy concerns, adversely disturb software maintainability, readability, and evolution. The exploration concentrated on two widely used opensource projects; Spring PetClinic (Java) and Axios (JavaScript)and utilized three static analysis tools: SonarQube, PMD, and JDeodorant. The enquiry was piloted in two phases: pre-refactoring smell detection and post-refactoring evaluation.Initial discoveries exposed a total of 72 code smell instances in Spring PetClinic and 25 in Axios, with Long Method (24 instances) and Duplicated Code (17 instances) being the most repeated in the previous, and Long Function (10 instances) and Deep Nesting (7 instances) predominant in the latter. These smells were dispersed across perilous files like VisitController.java and lib/core/Axios.js, indicating architectural hotspots. A heatmap analysis presented a strong correlation between code smell occurrence and code complexity, particularly in smells such as God Class (complexity score: 9/10) and Long Method (8/10).Following manual refactoring using Fowler’s catalog of techniques including Extract Method, Move Method, and Split Classsignificant decreases were attained. In Spring PetClinic, Long Method instances decreased by 50%, Duplicated Code by 70.5%, and Feature Envy by 54.5%. In Axios, Long Functions were compacted by 60%, Duplicated Logicby 62.5%, and Deep Nesting by 57.1%.Tool validation metrics establisheddiscrepancies in discoverycompetences: SonarQubeverified the maximumrecall (0.91), PMDthe maximumprecision (0.81), and JDeodorant a stable performance (F1-score = 0.81). These outcomesconfirmed that no single tool offers complete coverage, and a multitool approach, complemented by human verdict, is essential for dependable code quality valuation.Generally, the study endorses that bad code smells are language agnostic but context dependent, and that directed refactoring can yield up to 70% improvement in design quality. The exploration contributes practical comprehensions for developers, maintainers, and software quality analysts, encouraging for the integration of automated smell detection tools into continuous integration pipelines and the properaddition of code smell alertness in software engineering education.
Related articles
Related articles are currently not available for this article.