code: function isUsedVariable(variable) {
              const functionNodes = getFunctionDefinitions(variable),
                  isFunctionDefinition = functionNodes.length > 0;
              let rhsNode = null;
  
              return variable.references.some(ref => {
                  if (isForInRef(ref)) {
                      return true;
                  }
  
                  const forItself = isReadForItself(ref, rhsNode);
  
                  rhsNode = getRhsNode(ref, rhsNode);
  
                  return (
                      isReadRef(ref) &&
                      !forItself &&
                      !(isFunctionDefinition && isSelfReference(ref, functionNodes))
                  );
              });
          }
docs: Determines if the variable is used.
  @param {Variable} variable - The variable to check.
  @returns {boolean} True if the variable is used
  @private