check method
void
check(
- DcqRegistry registry
)
Implementation
@override
void check(
DcqRegistry registry,
) {
registry.addIfStatement((node) {
if (_isNestedElseIf(node)) return;
final branches = _collectBranches(node);
if (branches.length < 2) return;
final firstTarget = _getEnumComparisonTarget(branches.first);
if (firstTarget == null) return;
var allMatch = true;
for (final branch in branches.skip(1)) {
final target = _getEnumComparisonTarget(branch);
if (target == null || target != firstTarget) {
allMatch = false;
break;
}
}
if (allMatch) {
reportAtNode(node);
}
});
}