Ferramenta para qualificar a Complexidade Cognitiva do código utilizando a técnica Cognitive Driven Development

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.

Authors

Institutions

Publication Details

Journal
Anais do Computer on the Beach
Published
2025-05-27
DOI
https://doi.org/10.14210/cotb.v16.p509-511
Primary Topic
Software Engineering Techniques and Practices
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Ferramenta para qualificar a Complexidade Cognitiva do código utilizando a técnica Cognitive Driven Development

Marcela Leite, Ane Cristine Crispim
Anais do Computer on the Beach
Software Engineering Techniques and Practices
article

Ferramenta para qualificar a Complexidade Cognitiva do código utilizando a técnica Cognitive Driven Development

Marcela Leite, Ane Cristine Crispim
article en

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.

Anais do Computer on the Beach
Instituto Federal Catarinense (BR)
Openalex Percentile: Top 84%
Software Engineering Techniques and Practices
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.