<commit_before><cfscript>
  /*
    Replaces any framework method that is overridden by a plugin method
   */
  public any function $$pluginRunner() {

    local.methodName = GetFunctionCalledName();

    // setup our initial run result
    local.result = {
      $$methodArgs = duplicate(arguments)
    };

    // get our stack from $stack via the name this function was
    // called as
    local.stack = variables.$stacks[local.methodName];

    // loop through the stack
    for (local.i = 1; local.i lte arrayLen(local.stack); local.i++) {


      if (!isStruct(local.result) || !structKeyExists(local.result, "$$methodArgs"))
        return local.result;

      // get a variable that we can call as the method
      local.method = local.stack[local.i];

      // make the call and get our return value
      local.result = local.method(argumentCollection=local.result.$$methodArgs);
    }

    if (!isNull(local.result))
      return local.result;

    return;
  }

  /*
    Replaces core.method() from the plugin system to let $$overrideRunner know
    to move to the next method in the stack
   */
  public struct function $$pluginContinue() {

    return { $$methodArgs = arguments };
  }
</cfscript><commit_msg>removed $$pluginContinue and added code as necessary for recursively running plugin methods<commit_after><cfscript>
  public any function $$pluginRunner() {

    // get the method name called so that we know which stack to run
    local.methodName = GetFunctionCalledName();

    // get our stack from $stack via the name this function was called as
    local.stack = variables.$stacks[local.methodName];

    local.stackLen = arrayLen(local.stack);

    // setup our counter in the request scope so it can be shared as necessary
    if (!structKeyExists(request.wheels.stacks, local.methodName))
      request.wheels.stacks[local.methodName] = 0;

    // ++ the counter for our next method on the stack
    request.wheels.stacks[local.methodName]++;

    // if the developer has called core.method() without there actually being a
    // core method with that name, throw a nice wheels error
    if (request.wheels.stacks[local.methodName] > local.stackLen) {

      // make sure we reset our stack counter in case our expection is caught
      request.wheels.stacks[local.methodName] = 0;

      // throw a method not found error if core.method() doesn't have another
      // method in the stack
      $throw(
          type="Wheels.MethodNotFound"
        , message="The method `#local.methodName#` is part of a plugin but
          was not found in the base object."
      );
    }

    // get the method in the local scope without needing to be scoped
    var method = local.stack[request.wheels.stacks[local.methodName]];

    // if the method called throws an error we'll catch it, reset our counter
    // and rethrow the error
    try {
      local.result = method(argumentCollection=arguments);
    } catch (any e) {
      request.wheels.stacks[local.methodName] = 0;
      rethrow;
    }


    // now that we have a result, remove from our counter
    request.wheels.stacks[local.methodName]--;

    // can't return a null result from a variable
    if (!isNull(local.result))
      return local.result;

    // return null
    return;
  }
</cfscript>
{'fraction_non_alphanumeric': 0.09835566382460414, 'fraction_numerical': 0.001218026796589525, 'mean_word_length': 2.8020833333333335, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '487944', 'n_tokens_mistral': 929, 'n_tokens_neox': 891, 'n_words': 328}