العودة إلى القاموس
مراجعة الكود والجودةPopular

Code Smell

A surface indication in the source code that usually corresponds to a deeper problem in the system. Not a bug itself, but a sign that refactoring may be needed.

التعريف

The term "code smell" was coined by Kent Beck and popularized by Martin Fowler. Common code smells include: Long Methods (functions doing too much), God Classes (classes with too many responsibilities), Duplicate Code (copy-pasted logic), Feature Envy (methods that use another class's data more than their own), and Magic Numbers (unexplained numeric literals).

لماذا هو مهم

Code smells indicate potential maintainability problems. While they don't prevent code from working, they make it harder to understand, modify, and extend. Studies show that code with multiple smells has 2-3x higher defect rates. Addressing smells early prevents technical debt accumulation.

مثال

A method has 200 lines and 15 parameters — this is a "Long Method" code smell. It suggests the method should be broken into smaller, focused functions.

المصطلحات ذات الصلة

code smellwhat is code smellcode smells examplescode smell definition

أتمتة مراجعة الكود مع diffray

نظام ذكاء اصطناعي متعدد الوكلاء لمراجعة الكود. يجد الأخطاء والثغرات الأمنية ومشاكل البنية تلقائياً.