<commit_before>var utils = require('../utils')
var transactionStore = require('../transactionStore')

module.exports = function ($provide, traceBuffer) {
  // Controller Instrumentation
  $provide.decorator('$controller', ['$delegate', '$injector', function ($delegate, $injector) {
    return function () {
      var args = Array.prototype.slice.call(arguments)
      var controllerInfo = utils.getControllerInfoFromArgs(args)

      return utils.instrumentModule($delegate, $injector, {
        type: 'app.$controller',
        prefix: '$controller.' + controllerInfo.name
      }).apply(this, arguments)

      return $delegate.apply(this, args)
    }
  }])
}<commit_msg>Only instrument controllers where a name is resolvable <commit_after>var utils = require('../utils')
var transactionStore = require('../transactionStore')

module.exports = function ($provide, traceBuffer) {
  // Controller Instrumentation
  $provide.decorator('$controller', ['$delegate', '$injector', function ($delegate, $injector) {
    return function () {
      var args = Array.prototype.slice.call(arguments)
      var controllerInfo = utils.getControllerInfoFromArgs(args)

      if(controllerInfo.name) { // Only instrument controllers with a name
        return utils.instrumentModule($delegate, $injector, {
          type: 'app.$controller',
          prefix: '$controller.' + controllerInfo.name
        }).apply(this, arguments)
      }

      return $delegate.apply(this, args)
    }
  }])
}
{'fraction_non_alphanumeric': 0.13841998649561107, 'fraction_numerical': 0.0, 'mean_word_length': 3.7197452229299364, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7138220', 'n_tokens_mistral': 400, 'n_tokens_neox': 391, 'n_words': 93}