Bad smells of code can lead to significant software vulnerabilities that negatively affect the security attribute of software and make the software easily attacked. Method implementation is the lowest code level that produces bad smells in software. Several programming guidelines have been introduced to reduce the number of bad code smells. Some are related to security, while others are related to other software quality attributes. We can detect some of these guidelines by using quality metrics (e.g., the number of lines of code and the number of parameters). This project proposes applying data mining classifiers to automatically detect security code smells and non-security code smells based on software quality metrics. We developed eight models using eight classifiers: Logistic Regression, Random Forest, XG Boost, J48, SVM, Naive Bayes, LightGBM, and Neural Network. We evaluated the eight models using several performance measurements (e.g., accuracy and confusion metrics). The results showed that it could detect the security code smell from the non-security code smell with the highest accuracy of 95\%.