Early Career Developers’ Perceptions of Code Understandability: A Study of Complexity Metrics
Esposito, Matteo; Janes, Andrea; Kilamo, Terhi; Lenarduzzi, Valentina (2025-07-03)
Esposito, Matteo
Janes, Andrea
Kilamo, Terhi
Lenarduzzi, Valentina
IEEE
03.07.2025
M. Esposito, A. Janes, T. Kilamo and V. Lenarduzzi, "Early Career Developers’ Perceptions of Code Understandability: A Study of Complexity Metrics," in IEEE Access, vol. 13, pp. 135027-135042, 2025, doi: 10.1109/ACCESS.2025.3585777.
https://creativecommons.org/licenses/by/4.0/
© 2025 The Authors. This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
https://creativecommons.org/licenses/by/4.0/
© 2025 The Authors. This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
https://creativecommons.org/licenses/by/4.0/
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:oulu-202508155353
https://urn.fi/URN:NBN:fi:oulu-202508155353
Tiivistelmä
Abstract
Context:
Code understandability is crucial for developers, who continually modify the code to achieve changing business needs over time. Low understandability is associated with a significant increase in coding efforts and defect-proneness. To help assess code understandability, developers often use complexity metrics.
Objectives:
Our work investigates the predictive power of code understandability of two metrics: The first is the well-known cyclomatic complexity metric. In contrast, the second one is the recently introduced cognitive complexity metric by SonarQube. Moreover, we also distinguish the predictions of understandability in general and the severity of issues in particular.
Methods:
We designed and conducted an empirical study with 216 early career developers with professional experience ranging from one to four years. We asked them to manually inspect and rate the understandability of 12 Java classes that exhibit different levels of Cyclomatic and Cognitive Complexity. Results: Our findings show that the two complexity metrics are modest predictors of code understandability. Particularly, when controlling the sizes of classes, the predictive power of McCabe complexity drops substantially, while the same is noticeable for cognitive complexity. Furthermore, the two metrics have no predictive power for the severity of issues. We also discuss particular cases and provide qualitative insights into these observations.
Conclusions:
We concluded that low complexity values indicate good understandability, but high values do not necessarily show low understandability. We found no evidence that the measures can predict severity at all. Furthermore, we provided explanations of understandability and seriousness in light of both developers’ comments and the metric values.
Context:
Code understandability is crucial for developers, who continually modify the code to achieve changing business needs over time. Low understandability is associated with a significant increase in coding efforts and defect-proneness. To help assess code understandability, developers often use complexity metrics.
Objectives:
Our work investigates the predictive power of code understandability of two metrics: The first is the well-known cyclomatic complexity metric. In contrast, the second one is the recently introduced cognitive complexity metric by SonarQube. Moreover, we also distinguish the predictions of understandability in general and the severity of issues in particular.
Methods:
We designed and conducted an empirical study with 216 early career developers with professional experience ranging from one to four years. We asked them to manually inspect and rate the understandability of 12 Java classes that exhibit different levels of Cyclomatic and Cognitive Complexity. Results: Our findings show that the two complexity metrics are modest predictors of code understandability. Particularly, when controlling the sizes of classes, the predictive power of McCabe complexity drops substantially, while the same is noticeable for cognitive complexity. Furthermore, the two metrics have no predictive power for the severity of issues. We also discuss particular cases and provide qualitative insights into these observations.
Conclusions:
We concluded that low complexity values indicate good understandability, but high values do not necessarily show low understandability. We found no evidence that the measures can predict severity at all. Furthermore, we provided explanations of understandability and seriousness in light of both developers’ comments and the metric values.
Kokoelmat
- Avoin saatavuus [43406]

