fold/tests/fixtures/quality/structural_debt.cpp
trvon 2dcbdbc75d
feat: harden Fold quality guard
Preserve source, binary, and runtime evidence boundaries while making precision and performance regressions reproducible.

- decompose analysis orchestration into bounded modules
- add differential, metamorphic, organic, and Yams change-time gates
- fix detector, P-Code, fuzz sanitizer, and report identity precision
2026-07-13 15:05:35 -04:00

55 lines
1 KiB
C++

namespace structural_debt {
int normalizedTotalA(int value) {
int shifted = value + 1;
int doubled = shifted * 2;
return doubled;
}
int normalizedTotalB(int amount) {
int adjusted = amount + 1;
int result = adjusted * 2;
return result;
}
class CounterA {
public:
int twice(int value) { return value + value; }
int square(int value) { return value * value; }
};
class CounterB {
public:
int twice(int value) { return value * 2; }
int square(int value) { return value * value; }
};
int branchHeavy(int value) {
int score = 0;
if (value > 0)
++score;
if (value > 1)
++score;
if (value > 2)
++score;
if (value > 3)
++score;
if (value > 4)
++score;
if (value > 5)
++score;
return score;
}
int returnsBeforeCleanup(int value) {
return value;
value += 1;
return value;
}
static int orphanedHelper(int value) {
int adjusted = value - 3;
return adjusted * adjusted;
}
} // namespace structural_debt