check method
void
check(
- DcqRegistry registry
)
Implementation
@override
void check(
DcqRegistry registry,
) {
final threshold = configInt(ruleConfig, 'threshold') ?? _defaultThreshold;
registry.addIfStatement((node) {
if (_countBooleanOperators(node.expression) > threshold) {
reportAtNode(node.expression);
}
});
registry.addWhileStatement((node) {
if (_countBooleanOperators(node.condition) > threshold) {
reportAtNode(node.condition);
}
});
registry.addDoStatement((node) {
if (_countBooleanOperators(node.condition) > threshold) {
reportAtNode(node.condition);
}
});
}