check method

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

Implementation

@override
void check(
  DcqRegistry registry,
) {
  registry.addFunctionDeclaration((node) {
    final params = node.functionExpression.parameters;
    final body = node.functionExpression.body;
    if (params == null) return;

    _checkParameters(params, body);
  });

  registry.addMethodDeclaration((node) {
    final params = node.parameters;
    final body = node.body;
    if (params == null) return;

    _checkParameters(params, body);
  });

  registry.addFunctionExpression((node) {
    final params = node.parameters;
    final body = node.body;
    if (params == null) return;
    if (node.parent is FunctionDeclaration) return;

    _checkParameters(params, body);
  });
}