Functionality Based Code Smell Detection and Severity Classification

Omkarendra Tiwari, Rushikesh K. Joshi · 2020

The Long Method code smell is a symptom of design defects caused by implementing multiple tasks within a single method. It limits reusability, evolvability and maintainability of a method. In this paper, we present a functionality based approach for detecting long methods. Functionalities are identified through a novel block based dependency analysis technique called Segmentation. It clusters sets of statements into extract method opportunities (or tasks). The approach uses interdependencies among various extract method opportunities identified within the method as a means to measure severity of the long method smell. The approach is validated over a Java based open source code. A comparison with expert's assessment shows that the approach is promising in detecting severe methods irrespective of their sizes.

Read the paper · More papers on PaperTik