Logo PTI Logo FedCSIS

Proceedings of the 18th Conference on Computer Science and Intelligence Systems

Annals of Computer Science and Information Systems, Volume 35

Towards reliable rule mining about code smells: The McPython approach (Invited Lecture — Extended Abstract)

, , ,

DOI: http://dx.doi.org/10.15439/2023F2071

Citation: Proceedings of the 18th Conference on Computer Science and Intelligence Systems, M. Ganzha, L. Maciaszek, M. Paprzycki, D. Ślęzak (eds). ACSIS, Vol. 35, pages 6566 ()

Full text

Abstract. Code smell is a risky code pattern impacting code maintenance. Some of the code smells are defined by metrics (e.g., lines of code). Unfortunately, it is not clear how to set these thresholds for them. Goal: To propose a smell description language that allows querying code repositories to empirically determine impact of metric thresholds on severity of smells. Method: We propose a language, called McPython, that allows defining metric-based smells. We evaluate the expressiveness of the language by specifying some popular code smells. Results: McPython is a functional domain-specific language that allows defining smells as parameterized logical propositions with auxiliary functions. McPython code is translated to Python and executed on object-oriented representation of a code repository. Its current version is capable of expressing 7 code smells. Conclusion: Despite its limitations, McPython has the potential to help in investigating the impact of code smell parameters on their severity.