You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/software/code_quality/code_smells/dead_code.md
+254-7Lines changed: 254 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ date: 2025-02-04
7
7
8
8
# We use this key to indicate the last modified date [manual entry, use YYYY-MM-DD]
9
9
# Uncomment and populate the next line accordingly
10
-
date-modified: 2025-09-19
10
+
date-modified: 2025-12-05
11
11
12
12
# Do not modify
13
13
lang: en
@@ -17,7 +17,7 @@ language:
17
17
18
18
# Title of the document [manual entry]
19
19
# Uncomment and populate the next line accordingly
20
-
title: Commented-out code
20
+
title: Dead code
21
21
22
22
# Brief overview of the document (will be used in listings) [manual entry]
23
23
# Uncomment and populate the next line and uncomment "hide-description: true".
@@ -27,7 +27,7 @@ title: Commented-out code
27
27
# Authors of the document, will not be parsed [manual entry]
28
28
# Uncomment and populate the next lines accordingly
29
29
author_1: Maurits Kok
30
-
#author_2:
30
+
author_2:Manuel Garcia
31
31
32
32
# Maintainers of the document, will not be parsed [manual entry]
33
33
# Uncomment and populate the next lines accordingly
@@ -47,7 +47,7 @@ categories:
47
47
48
48
---
49
49
50
-
Dead code refers to unused or unreachable code that remains in the codebase but serves no functional purpose. Commented-out code consists of inactive code blocks that developers have disabled rather than deleting. Both contribute to clutter and reduce maintainability.
50
+
Dead code refers to unused or unreachable code that remains in the codebase, but serves no functional purpose. Commented-out code consists of inactive code blocks that developers have disabled rather than deleting. Both contribute to clutter and reduce maintainability.
51
51
52
52
## Symptoms
53
53
@@ -60,6 +60,253 @@ Dead code refers to unused or unreachable code that remains in the codebase but
60
60
Do not use comments to change the behavior of the code. Instead, make use of input parameters or configuration settings to control the behavior of the code.
61
61
:::
62
62
63
-
## Solution
64
-
- If code is not needed, delete it. Use version control (e.g., Git) to restore it if necessary. Commit the removal of the commented-out code with a meaningful commit message explaining why it was removed. This allows you to track the change and easily revert it if necessary.
65
-
- To change the executation of your code, use [input parameters or configuration settings](./hardcoded_values.md) to control the behavior of the code. This makes the code more readable and maintainable.
63
+
## Example - Dead code
64
+
65
+
Unreachable or unused code that remains in the codebase but serves no purpose.
0 commit comments