anchor.diff:    _Visitor(this.rule, this.context);
   
     @override
  -  void visitSimpleIdentifier(SimpleIdentifier identifier) {
  -    // Should be "length".
  -    var propertyElement = identifier.staticElement;
  -    if (propertyElement?.name != 'length') {
  -      return;
  -    }
  -
  -    AstNode? lengthAccess;
  -    InterfaceType? type;
  -
  -    var parent = identifier.parent;
  -    if (parent is PropertyAccess && identifier == parent.propertyName) {
  -      lengthAccess = parent;
  -      var parentType = parent.target?.staticType;
  -      if (parentType is InterfaceType) {
  -        type = parentType;
  -      }
  -    } else if (parent is PrefixedIdentifier &&
  -        identifier == parent.identifier) {
  -      lengthAccess = parent;
  -      var parentType = parent.prefix.staticType;
  -      if (parentType is InterfaceType) {
  -        type = parentType;
  -      }
  -    }
  -
  -    if (type == null) {
  -      return;
  -    }
  -
  -    // Should be subtype of Iterable, Map or String.
  -    if (!DartTypeUtilities.implementsInterface(type, 'Iterable', 'dart.core') &&
  -        !DartTypeUtilities.implementsInterface(type, 'Map', 'dart.core') &&
  -        !type.isDartCoreString) {
  -      return;
  -    }
  -
  -    var search = lengthAccess;
  -    while (
  -        search != null && search is Expression && search is! BinaryExpression) {
  -      search = search.parent;
  -    }
  -
  -    if (search is! BinaryExpression) {
  -      return;
  -    }
  -    var binaryExpression = search;
  -
  +  void visitBinaryExpression(BinaryExpression node) {
  +    var value = _getIntValue(node.rightOperand);
  +    if (value != null) {
  +      if (_isLengthAccess(node.leftOperand)) {
  +        _check(node, value, constantOnRight: true);
  +      }
  +    } else {
  +      value = _getIntValue(node.leftOperand);
  +      // ignore: invariant_booleans
  +      if (value != null) {
  +        if (_isLengthAccess(node.rightOperand)) {
  +          _check(node, value, constantOnRight: false);
  +        }
  +      }
  +    }
  +  }
  +
  +  void _check(BinaryExpression expression, int value,
  +      {required bool constantOnRight}) {
       // Don't lint if we're in a const constructor initializer.
       var constructorInitializer =
  -        search.thisOrAncestorOfType<ConstructorInitializer>();
  +        expression.thisOrAncestorOfType<ConstructorInitializer>();
       if (constructorInitializer != null) {
         var constructorDecl = constructorInitializer.parent;
         if (constructorDecl is! ConstructorDeclaration ||
  
positive.code:     // ignore: avoid_returning_null
      return null;
    }
  }
  
negative.code:   void registerNodeProcessors(
        NodeLintRegistry registry, LinterContext context) {
      var visitor = _Visitor(this, context);
      registry.addBinaryExpression(this, visitor);
    }
  
    void reportLintWithDescription(AstNode node, String description) {
      reporter.reportErrorForNode(_LintCode(name, description), node, []);
    }
  }
  
  