check method

  1. @override
void check(
  1. DcqRegistry registry
)

Implementation

@override
void check(DcqRegistry registry) {
  final maxLength = effectiveInt('max-length', 50);
  final ignoredNames = effectiveString(
    'ignored-names',
    'build',
  ).split(',').map((s) => s.trim()).where((s) => s.isNotEmpty).toSet();

  registry.addFunctionDeclaration((node) {
    if (ignoredNames.contains(node.name.lexeme)) return;
    final body = node.functionExpression.body;
    _checkBody(body, node, maxLength);
  });

  registry.addMethodDeclaration((node) {
    if (ignoredNames.contains(node.name.lexeme)) return;
    _checkBody(node.body, node, maxLength);
  });
}