ABSTRACT
This work proposed the development of an extension for Visual Studio Code, which supports the PHP programming language, using the Cognitive Driven Development (CDD) method to identify the cognitive complexity of the source code. The extension helps the developer to locate code snippets with unnecessary complexity, encouraging the application of refactoring techniques and good code design practices. For this purpose, research related to CDD was analyzed and the necessary parameters for the creation of a configuration file in JSON were defined. Due to the limitation of the VS Code API, which does not provide the AST (Abstract Syntax Tree) of the code, it was decided to integrate the Php-parser library, written in JavaScript, which proved to be compatible with the Typescript development environment. The tool was validated through tests on a real project, comparing its performance before and after refactoring. In the initial analysis, the extension correctly identified the critical points that needed improvement. After refactoring, a reduction in the identified complexity was observed, evidencing the effectiveness of the tool, even when applied to a small project. In summary, the extension proves to be an effective solution for automating the identification of cognitive complexity, contributing to more efficient software development and continuous maintenance of source code.
O Computer on the Beach é um evento técnico-científico que visa reunir profissionais, pesquisadores e acadêmicos da área de Computação, a fim de discutir as tendências de pesquisa e mercado da computação em suas mais diversas áreas.