Unveiling Inefficiencies in Open-Source Code Using Multistage Analysis with Software Metrics

Authors

  • Rasheed Mohammed Alnofah Department of Computer Science & Information Technology, University of Baluchistan Quetta, Pakistan
  • Muhammad Shumail Naveed Department of Computer Science & Information Technology, University of Baluchistan Quetta, Pakistan

Keywords:

Software Development, Code Maintenance, Open-source code, Cyclomatic Complexity, Maintainability Index

Abstract

Software development is challenging due to its technical complexity and time-consuming nature. To overcome these difficulties, various technical solutions have been introduced. In commercial software development, code repositories serve as valuable resources, reducing the time and cost involved in the process. The utilization of pre-developed open code repositories has proven to reduce development time. However, ample amount of work has not determined whether these repositories are testable, maintainable, free of dead code, and have a concise implementation of equivalent algorithms. The objective of this article is to address this gap by thoroughly analyzing the complexity and maintainability of code repositories, determining the impact of removing dead code on size, complexity, and maintainability. For this study, a total of 200 Python open-source code were analyzed using RADON, a widely-used metric tool for assessing cyclomatic complexity, size, volume, and maintainability. The identification of dead code within the repositories was accomplished using Vulture, supplemented by expert evaluation. It has been revealed that the majority of the examined code included dead code, and the removal of this code led to a significant reduction in cyclomatic complexity, volume, and size, while improving code maintainability, as observed by the Mann Whitney U test. The study concludes that the blind use of open-source code is not safe. It strongly recommends the community to thoroughly explore and examine such code from different perspectives before actual implementation. The novelty of this study lies in the use of multiple software metrics in a multi-stage analysis to examine the impact of removing dead code on program complexity, size, and maintainability.

References

“INTRODUCTION TO COMPUTER PROGRAMMING (BASIC).” https://www.researchgate.net/publication/317182495_INTRODUCTION_TO_COMPUTER_PROGRAMMING_BASIC (accessed Oct. 02, 2023).

“Python current trend applications-an overview.” https://www.researchgate.net/publication/344569950_Python_current_trend_applications-an_overview (accessed Oct. 02, 2023).

M. S. Naveed and M. Sarim, “Two-Phase CS0 for Introductory Programming: CS0 for CS1,” Proc. Pakistan Acad. Sci. A. Phys. Comput. Sci., vol. 59, no. 1, pp. 59–70, Jun. 2022, doi: 10.53560/PPASA(59-1)710.

“Software Developer Jobs Will Increase Through 2026 | Dice.com Career Advice.” https://www.dice.com/career-advice/software-developer-jobs-increase-2026 (accessed Oct. 02, 2023).

M. S. Naveed, “Comparison of C++ and Java in Implementing Introductory Programming Algorithms,” Quaid-E-Awam Univ. Res. J. Eng. Sci. Technol. Nawabshah., vol. 19, no. 1, pp. 95–103, Jun. 2021, doi: 10.52584/QRJ.1901.14.

A. Moss, R. Schluntz, and P. A. Buhr, “C: Adding modern programming language features to C,” Softw. Pract. Exp., vol. 48, no. 12, pp. 2111–2146, Dec. 2018, doi: 10.1002/SPE.2624.

“View of C in CS1: Snags and Viable Solution.” https://publications.muet.edu.pk/index.php/muetrj/article/view/91/45 (accessed Oct. 02, 2023).

C. Sanderson and R. Curtin, “Armadillo: a template-based C++ library for linear algebra,” J. Open Source Softw., vol. 1, no. 2, p. 26, Jun. 2016, doi: 10.21105/JOSS.00026.

J. Gosling, B. Joy, G. Steele, G. Bracha, and A. Buckley, “The Java ® Language Specification Java SE 8 Edition,” 1997.

G. O’Regan, “The Innovation in Computing Companion,” Innov. Comput. Companion, 2018, doi: 10.1007/978-3-030-02619-6.

C. Severance, “Guido van Rossum: The early years of python,” Computer (Long. Beach. Calif)., vol. 48, no. 2, pp. 7–9, Feb. 2015, doi: 10.1109/MC.2015.45.

G. M. M. Bashir and A. S. M. L. Hoque, “An effective learning and teaching model for programming languages,” J. Comput. Educ. 2016 34, vol. 3, no. 4, pp. 413–437, Jul. 2016, doi: 10.1007/S40692-016-0073-2.

D. Rodriguez, I. Herraiz, and R. Harrison, “On software engineering repositories and their open problems,” 2012 1st Int. Work. Realiz. AI Synerg. Softw. Eng. RAISE 2012 - Proc., pp. 52–56, 2012, doi: 10.1109/RAISE.2012.6227971.

L. Ardito, R. Coppola, L. Barbato, and D. Verga, “A Tool-Based Perspective on Software Code Maintainability Metrics: A Systematic Literature Review,” Sci. Program., vol. 2020, 2020, doi: 10.1155/2020/8840389.

D. Knight, S. Torri, and T. Bhowmik, “A Preliminary Critical Review of the Impact of Three Popular Development Practices on Source Code Maintainability,” Proc. - Int. Comput. Softw. Appl. Conf., vol. 2023-June, pp. 1633–1637, 2023, doi: 10.1109/COMPSAC57700.2023.00252.

P. Quality, F. Sholichin, M. Adham, S. A. Halim, and M. Firdaus Bin Harun, “REVIEW OF IOS ARCHITECTURAL PATTERN FOR TESTABILITY,” J. Theor. Appl. Inf. Technol., vol. 15, no. 15, 2019, Accessed: Oct. 02, 2023. [Online]. Available: www.jatit.org

V. Garousi, M. Felderer, and F. N. Kılıçaslan, “A survey on software testability,” Inf. Softw. Technol., vol. 108, pp. 35–64, Apr. 2019, doi: 10.1016/J.INFSOF.2018.12.003.

M. S. Naveed, “Correlation Between GitHub Stars and Code Vulnerabilities,” J. Comput. Biomed. Informatics, vol. 4, no. 01, pp. 141–151, Dec. 2022, doi: 10.56979/401/2022/111.

“Analysis of Code Vulnerabilities in Repositories of GitHub and Rosettacode: A comparative Study | International Journal of Innovations in Science & Technology.” https://journal.50sea.com/index.php/IJIST/article/view/289 (accessed Oct. 02, 2023).

M. Scotto, A. Sillitti, and G. Succi, “AN EMPIRICAL ANALYSIS OF THE OPEN SOURCE DEVELOPMENT PROCESS BASED ON MINING OF SOURCE CODE REPOSITORIES,” https://doi.org/10.1142/S0218194007003215, vol. 17, no. 2, pp. 231–247, Nov. 2011, doi: 10.1142/S0218194007003215.

P. Bhattarai, M. Ghassemi, and T. Alhanai, “Open-source code repository attributes predict impact of computer science research,” Proc. ACM/IEEE Jt. Conf. Digit. Libr., Jun. 2022, doi: 10.1145/3529372.3530927.

D. L. Vu, I. Pashchenko, F. Massacci, H. Plate, and A. Sabetta, “Towards Using Source Code Repositories to Identify Software Supply Chain Attacks,” Proc. ACM Conf. Comput. Commun. Secur., pp. 2093–2095, Oct. 2020, doi: 10.1145/3372297.3420015.

R. Raducu, G. Esteban, F. J. R. Lera, and C. Fernández, “Collecting Vulnerable Source Code from Open-Source Repositories for Dataset Generation,” Appl. Sci. 2020, Vol. 10, Page 1270, vol. 10, no. 4, p. 1270, Feb. 2020, doi: 10.3390/APP10041270.

B. Norick, J. Krohn, E. Howard, B. Welna, and C. Izurieta, “Effects of the number of developers on code quality in open source software: A case study,” ESEM 2010 - Proc. 2010 ACM-IEEE Int. Symp. Empir. Softw. Eng. Meas., 2010, doi: 10.1145/1852786.1852864.

D. R. Wijendra, S. Lanka, and K. P. Hewagamage, “Analysis of Cognitive Complexity with Cyclomatic Complexity Metric of Software General Terms,” Int. J. Comput. Appl., vol. 174, no. 19, pp. 975–8887, 2021.

“The Impact of Language Syntax on the Complexity of Programs: A Case Study of Java and Python | International Journal of Innovations in Science & Technology.” https://journal.50sea.com/index.php/IJIST/article/view/339 (accessed Oct. 02, 2023).

M. Shepperd, “A critique of cyclomatic complexity as a software metric,” Softw. Eng. J., vol. 3, no. 2, p. 30, 1988, doi: 10.1049/SEJ.1988.000310.1049/SEJ.1988.0003.

A. Odeh, M. Odeh, N. Odeh, and H. Odeh, “Machine Learning Model for Measuring Cyclomatic Complexity of Source Code,” 2023 Int. Conf. Intell. Comput. Commun. Netw. Serv. ICCNS 2023, pp. 149–153, 2023, doi: 10.1109/ICCNS58795.2023.10193630.

M. S. naveed, “Measuring the Programming Complexity of C and C++ using Halstead Metrics:,” Univ. Sindh J. Inf. Commun. Technol. , vol. 5, no. 4, pp. 158–165, 2021, Accessed: Oct. 02, 2023. [Online]. Available: https://sujo.usindh.edu.pk/index.php/USJICT/article/view/4073

G. Yenduri and V. Naralasetti, “A Nonlinear Weight-Optimized Maintainability Index of Software Metrics by Grey Wolf Optimization,” Int. J. Swarm Intell. Res., vol. 12, no. 2, pp. 1–21, Apr. 2021, doi: 10.4018/IJSIR.2021040101.

Downloads

Published

2023-10-02

How to Cite

Alnofah, R. M., & Muhammad Shumail Naveed. (2023). Unveiling Inefficiencies in Open-Source Code Using Multistage Analysis with Software Metrics. International Journal of Innovations in Science & Technology, 5(4), 360–370. Retrieved from https://journal.50sea.com/index.php/IJIST/article/view/531

Issue

Section

Articles