Detecting Code Smells in Elixir Using Metrics and Predicates for Functional Programming

  • Erick Soares de Souza UFMG
  • João Marcelo F. de Almeida UFMG
  • Marco Tulio Valente UFMG
  • Mateus Dias UFV
  • Lucas Vegi UFV

Resumo


Code smells are design problems that hinder long-term code maintenance. Although widely studied in object-oriented languages, functional languages such as Elixir still lack mechanisms for the automatic detection of these problems. Although previous work cataloged 35 code smells specific to Elixir, no metrics or tools have been proposed for their automatic detection. This paper proposes metrics and predicates for detecting 8 of the 9 Low-Level Concerns in this catalog, a category composed of smells that affect small and isolated code structures. The validation is performed on ExSmell-Train, a dataset containing examples of code smells in Elixir, achieving recall equal to or greater than 80% in all analyzed cases.

Palavras-chave: Code Smell, Elixir, Functional Programming, Software Metrics, Static Analysis

Referências

Tiago L. Alves, Christiaan Ypma, and Joost Visser. 2010. Deriving Metric Thresholds from Benchmark Data. In 26th IEEE International Conference on Software Maintenance (ICSM). 1–10. DOI: 10.1109/ICSM.2010.5609747

Francesca Arcelli Fontana, Vincenzo Ferme, Marco Zanoni, and Aiko Yamashita. 2015. Automatic Metric Thresholds Derivation for Code Smell Detection. In 6th IEEE/ACM International Workshop on Emerging Trends in Software Metrics (WETSoM). 44–53. DOI: 10.1109/WETSoM.2015.14

Joe Armstrong. 2007. A history of Erlang. In 3rd ACM SIGPLAN conference on History of programming languages (HOPL). 6–1.

Checkstyle Contributors. 2026. Checkstyle. [link].

Shyam R Chidamber and Chris F Kemerer. 1994. A metrics suite for object oriented design. IEEE Transactions on software engineering 20, 6 (1994), 476–493.

Elixir Team. 2020. Real Time Communication at Scale with Elixir at Discord. [link] Accessed: 2026.

Erlang Solutions. 2021. Bleacher Report Case Study. [link] Accessed: 2026.

Klaus Erni and Claus Lewerentz. 1996. Applying design-metrics to object-oriented frameworks. In 3rd International Software Metrics Symposium (METRICS). 64–74.

Norman Fenton and James Bieman. 2014. Software metrics: a rigorous and practical approach. CRC press.

Eduardo Fernandes, Johnatan Oliveira, Gustavo Vale, Thanis Paiva, and Eduardo Figueiredo. 2016. A review-based comparative study of bad smell detection tools. Information and Software Technology 74 (2016), 36–49.

René Föhring. 2026. Credo: A static code analysis tool for the Elixir language. [link].

Martin Fowler. 2018. Refactoring: improving the design of existing code. Addison-Wesley Professional.

Saša Jurić. 2024. Elixir in action (3 ed.). Manning.

R. Marinescu. 2001. Detecting design flaws via metrics in object-oriented systems. In 39th International Conference and Exhibition on Technology of Object-Oriented Languages and Systems (TOOLS). 173–182.

R. Marinescu. 2005. Measurement and quality in object-oriented design. In 21st IEEE International Conference on Software Maintenance (ICSM). 701–704.

Thomas J McCabe. 1976. A complexity measure. IEEE Transactions on software Engineering 4 (1976), 308–320.

Paloma Oliveira, Marco Tulio Valente, and Fernando Lima. 2014. Extracting Relative Thresholds for Source Code Metrics. In IEEE Conference on Software Maintenance, Reengineering and Reverse Engineering (CSMR-WCRE). 254–263.

PMD Contributors. 2026. PMD Source Code Analyzer. [link].

Elder Sobrinho, Andrea De Lucia, and Marcelo Maia. 2021. A systematic literature review on bad smells–5 w’s: which, when, what, who, where. IEEE Transactions on Software Engineering 47, 1 (2021), 17–66. DOI: 10.1109/TSE.2018.2880977

The Elixir Team. [n. d.]. Elixir Programming Language. [link]

Nikolaos Tsantalis and Alexander Chatzigeorgiou. 2008. JDeodorant: Identification and application of extract class refactorings. In 12th European Conference on Software Maintenance and Reengineering (CSMR). 275–279.

José Valim. 2021. Marketing and Sales Intelligence with Elixir at PepsiCo. [link] Accessed: 2026.

Lucas Francisco da Matta Vegi. 2024. Code Smells and refactorings for Elixir. Ph.D. Thesis. Universidade Federal de Minas Gerais.

Lucas Francisco da Matta Vegi and Marco Tulio Valente. 2023. Understanding code smells in Elixir functional language. Empirical Software Engineering 28, 4 (2023), 1–36.
Publicado
08/09/2026
SOUZA, Erick Soares de; ALMEIDA, João Marcelo F. de; VALENTE, Marco Tulio; DIAS, Mateus; VEGI, Lucas. Detecting Code Smells in Elixir Using Metrics and Predicates for Functional Programming. In: WORKSHOP EM ENGENHARIA DE SOFTWARE PARA PROGRAMAÇÃO FUNCIONAL (SE4FP), 2. , 2026, São Paulo/SP. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2026 . p. 36-41. DOI: https://doi.org/10.5753/se4fp.2026.32912.