Title: Code sniffer: a risk based smell detection framework to enhance code quality using static code analysis
Authors: Ahmad Tahmid; Md. Nurul Ahad Tawhid; Sumon Ahmed; Kazi Sakib
Addresses: Institute of Information Technology, University of Dhaka, Dhaka, Bangladesh ' Institute of Information Technology, University of Dhaka, Dhaka, Bangladesh ' Institute of Information Technology, University of Dhaka, Dhaka, Bangladesh ' Institute of Information Technology, University of Dhaka, Dhaka, Bangladesh
Abstract: To maintain software and enhance its code quality, code smell, i.e., undesired design flaws need to be detected. However, as the system size increases, manual smell detection becomes difficult. In this paper, a static code analysis framework, named code sniffer, is proposed to detect code smells with predicting their risk severity. This has been calculated using code metrics, and defined as low, moderate and high. The system consists of three main components: parser extracts a syntax tree from the given source code to identify the code structure. The syntax tree is searched against the syntax of class and method. Analyser searches found classes and methods against various code syntax to identify key features like line of code (LOC), number of properties (NOP), etc. In smell and risk detector, code smells, risky code segments and their severity are detected as a set of quantitative values (using LOC, NOP, etc.) using which classes and methods are judged. A comparative case study of this risk based static analyser is performed with a dynamic analyser, FxCop, and the comparison results support each other.
Keywords: code smell; static analysis; risk based smell detection; code quality.
DOI: 10.1504/IJSETA.2017.086988
International Journal of Software Engineering, Technology and Applications, 2017 Vol.2 No.1, pp.41 - 63
Received: 05 Jul 2016
Accepted: 05 May 2017
Published online: 03 Oct 2017 *