Feature Envy is a code smell due to the abnormal calling relationships between methods and classes, which adversely affects software scalability and maintainability. Existing methods mainly use various technologies to model abnormal relationships to detect feature envy. However, these methods only rely on local features such as entity names, which is not robust enough. Moreover, the mining depth of correlation features between entities involved in feature envy is limited. In this paper, we propose a correlation feature mining model based on dual attention to detect feature envy. Firstly, we propose a multi-view-based entity representation strategy, which enhanced the robustness of the model while improving the suitability of the correlation feature and model. Secondly, we add attention mechanism to the channel dimension and spatial dimension of CNN to control the flow of information and capture the correlation features between entities more accurately. Finally, the evaluation results on projects both with and without feature envy injected show that our proposed approach outperforms the state-of-the-art methods.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.