Identificação de oportunidades de refatoração e análise da qualidade de código por meio de métricas de código-fonte - Barichello, Luís Gustavo Egger (2022)
Maintaining software with a complex internal structure is a difficult task to perform. For this, refactoring techniques are applied in order to improve code, increase quality and thus facilitate software maintenance. However, the mechanisms for manually refactoring are complex and require a great deal of technical effort; consequently, they are often left out or under-implemented by developers. Many IDEs used today make refactoring easier but do not apply them automatically, the developer still needs to identify refactoring opportunities and manually apply them. This study aims to provide a tool called RefactorExtension to use as a plugin for identifying refactoring opportunities and applying them automatically in JavaScript files. This plugin performs the analysis of the source code using the conversion to AST, and to validate the improvement of the applied refactoring, an analysis of the metrics of the source code is performed. To validate the RefactorExtension plugin, an experimental evaliation was conducted in three different projects. The tool showed signs of an effective improvement in the source code metrics after the application of refactorings. It was finished with this work that the application of refactorings directly affect the quality metrics of a source code, thus facilitating its maintenance and natural evolution.