Code smells (CS) are a severe symptom in software source code that leads to a serious problem in software maintenance and evolution. Feature Envy (FE) is a type of CS that refers to methods that are misplaced in the source code. Many tools like infusion, JDeodorant and JspIRIT have been used to identify the CS. The conversion of source code measurements into predictions is based on manually constructed heuristics. But, manually selecting good features and constructing optimal heuristics is a challenging issue. So, automatic detection of CS is required. The Deep Learning (DL) methods play an important role in achieving the automatic detection of FE(DLFED). The FE detection approach based on DL is intended to discover misplaced methods. The DL technique automatically identifies the source code characteristics for FE identification as well as automatically improves the difficult mapping structure between the features and their prediction. But, a DL-based automatic detection of CS requires a significant number of features with labeled training datasets to provide better prediction results. Therefore, an extension of the DL-based FE detection technique (EDLFED-FM) is proposed in this article to detect both misplaced methods and fields. The semantic relationship between identifiers in the source code program is used to extract the features of misplaced fields and methods. The new decomposition slice method is proposed to convert the extracted features of misplaced methods and fields into the slicing vector composition. This sliced feature helps deep learners understand the relationship between misplaced methods and fields. This automated method is capable of producing labeled training data for DL techniques-based classifiers without the requirement for human intervention. Finally, the experimental outcomes proved that precision rate of suggested method outperforms the JDeodorant and DLFED methods by 14.49% and 10.29 % for free plane, 14.72 % and 12.2 % for Junit, and 21.84% and 14.68 % for JExcelapi applications. Hence, it has been demonstrated that the predicted misplaced methods and fields are moved to the refactoring class for positive testing of source code program with less training data.