# Duplicated Code

*noun*

say it: **“DOO-plih-kay-tid kohd”** **/ˈdupləˌkeɪtɪd koʊd/**

A code smell: the same logic copied into several places, so each change has to find and update every copy.

## What is the code smell **duplicated code**?

**Duplicated code** is the same logic copied into several places, such as the check "is this today's special?" written out in the price code, the menu board and the receipt. It works until one copy is changed and the others aren't: then the menu board and the receipt disagree. The usual cure is small: pull the logic into one method, and have every place ask it.

## In a sentence

- “The menu board and the receipt disagreed because of **duplicated code**: the special check was copied into both.”

Level: Apprentice · [More Software Development terms at this level](https://www.ask-codey.com/glossary?category=software-development&level=2)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/duplicated-code
