CWE-1041 · Słabość
Use of Redundant Code
- Abstrakcja
- Bazowa
- Status
- Niekompletny
- Dodano
- 2 lipca 2018
- Ostatnia zmiana
- 11 grudnia 2025
Opis
The product has multiple functions, methods, procedures, macros, etc. that contain the same code.
Skutki
Other
Reduce Maintainability
This issue makes it more difficult to maintain the product, which indirectly affects security by making it more difficult or time-consuming to find and/or fix vulnerabilities. For example, if there are two copies of the same code, the programmer might fix a weakness in one copy while forgetting to fix the same weakness in another copy.
Zapobieganie
Implementation
Merge common functionality into a single function and then call that function from across the entire code base.
Słabość nadrzędna
Kiedy powstaje
- Implementation
Dotyczy
Not Language-Specific
Źródła
- Automated Source Code Maintainability Measure (ASCMM) — Object Management Group (OMG), ASCMM-MNT-19, 2016
Wpis z katalogu CWE 4.20.