Code smell detection is an important part of software engineering because code smells can reveal hidden structural or design problems in source code. Although they do not always cause direct program errors, they can make the code harder to read, main-tain, extend, and improve over time. The application of code smell detection helps de-velopers identify problematic methods and classes early, support refactoring decisions, reduce maintenance effort, and control technical debt. Long Method and Large Class are two important code smells because they are closely related to size, complexity, co-hesion, coupling, and the distribution of responsibilities in the code. Although automated code smell detection has improved, many existing methods still treat each code entity as an independent sample and mainly rely on software metrics or learned features. This may overlook hidden relationships among similar code entities, which can limit detection performance. Therefore, this thesis investigates whether rela-tional information extracted from software metric patterns can improve code smell de-tection. This study proposes a feature-enriched framework that combines K-Means clustering, ARM, and Boolean undirected graph construction. Within stratified 5-fold cross-validation, leakage-safe preprocessing is applied, and K-Means groups software entities with similar metric patterns. The cluster metric table is converted into a Boolean trans-action table, and the top 50% of Apriori rules ranked by lift are used to build a Boolean undirected graph. Six graph-based features are extracted from the Boolean graph and assigned to software entities based on their cluster membership. These features are combined with the original software metrics to create the proposed enriched feature rep-resentation. The experiments are conducted using two C# software metric datasets: Long Method and Large Class. Five classifiers are evaluated: Random Forest, CatBoost, Logistic Re-gression, Support Vector Machine, and Decision Tree. The models are assessed using Accuracy, AUC, and F1-score. The results show that the proposed graph-enriched representation improves code smell detection compared with the baseline metric-only approach. CatBoost achieved the best Class-1 F1-score, reaching 0.9172 for Large Class with SMOTE and 0.8773 for Long Method without balancing. Overall, the findings show that Vertical-Style ARM and Boolean graph features improve the detection of Large Class and Long Method code smells.