Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Code smell
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Class-level smells=== * ''Large class'', or a ''[[God object]]'': a [[Class (computer science)|class]] that contains too many types or contains many unrelated methods.{{fact|date=March 2025}} * ''Refused bequest'': a class that [[Method overriding (programming)|override]]s a method of a base class in such a way that the [[contract (software)|contract]] of the [[base class]] is not honored by the [[derived class]], violating the [[Liskov substitution principle]].{{fact|date=March 2025}} * ''Excessive use of literals'' or ''[[Magic number (programming)|magic numbers]]'': these should be coded as named constants, to improve readability and to avoid programming errors. Additionally, [[literal (computer programming)|literal]]s can and should be externalized into resource files/scripts, or other data stores such as databases where possible, to facilitate localization of software if it is intended to be deployed in different regions.<ref>{{Cite web|url=https://maximilianocontieri.com/code-smell-02-constants-and-magic-numbers|title=Constants and Magic Numbers|access-date=2020-11-03}}</ref>{{self published inline|date=March 2025|certain=y}} * ''[[Downcasting]]'': a type cast which breaks the abstraction model; the abstraction may have to be refactored or eliminated.<ref>{{cite web |author=Miller, Jeremy |title=Downcasting is a code smell |url=http://codebetter.com/jeremymiller/2006/12/26/downcasting-is-a-code-smell/ |access-date=4 December 2014 |url-status=dead |archive-url=https://web.archive.org/web/20190216193452/http://codebetter.com/jeremymiller/2006/12/26/downcasting-is-a-code-smell/ |archive-date=16 February 2019 }}</ref>{{self published inline|date=March 2025|certain=y}} * ''[[Data Clump (Code Smell)|Data clump]]'': Occurs when a group of variables are passed around together in various parts of the program. In general, this suggests that it would be more appropriate to formally group the different variables together into a single object, and pass around only the new object instead.<ref>{{Cite web|url=https://martinfowler.com/bliki/DataClump.html|title=DataClump|last=Fowler|first=Martin|access-date=2017-02-03}}</ref><ref>{{Cite web|url=https://sourcemaking.com/refactoring/smells/data-clumps|title=Design Patterns and Refactoring|website=sourcemaking.com|language=en|access-date=2017-02-04}}</ref>{{Unreliable source?|date=March 2025}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)