code: private boolean insideAssignmentToIdConstant(Node n) {
      Node parent = n.getParent();
      if (parent.isAssign()) {
        String qname = parent.getFirstChild().getQualifiedName();
        return qname != null && isIdName(qname);
      } else if (parent.isName()) {
        Node grandParent = parent.getParent();
        if (grandParent != null && NodeUtil.isNameDeclaration(grandParent)) {
          String name = parent.getString();
          return isIdName(name);
        } else {
          return false;
        }
      } else {
        return false;
      }
    }
docs: Returns whether the node is the right hand side of an assignment or
  initialization of a variable named *_ID of *_ID_.