<commit_before>(function() {
  'use strict';

  var app = angular.module('goteoStatistics');

  app.config(['$routeProvider', function($routeProvider) {
    $routeProvider.when('/home/:locale', {
      templateUrl: 'views/home.html',
      controller: 'HomeCtrl',
      dependencies: [ 'locale' ],
      resolve: {
        categories: [
          'GoteoApi', function(GoteoApi) {
            return GoteoApi.getCategories();
          }
        ],
        homeData: [
          '$route',
          'GoteoApi', function($route, GoteoApi) {
            var locale = $route.current.params.locale;
            return GoteoApi.getData('summary', locale, null, null);
          }
        ]
      }
    });
  }]);

  app.controller('HomeCtrl', [
    '$timeout',
    '$translate',
    '$scope',
    '$rootScope',
    '$routeParams',
    'categories',
    'homeData',
    function ($timeout, $translate, $scope, $rootScope, $routeParams, categories, homeData) {
      $rootScope.categories = categories;
      $rootScope.locale = $routeParams.locale;
      $rootScope.category = $rootScope.category || -1000;
      $rootScope.year = $rootScope.year || moment().year();

      /**
       * Process data to be used in charts.
       */<commit_msg>default year : current - 1<commit_after>(function() {
  'use strict';

  var app = angular.module('goteoStatistics');

  app.config(['$routeProvider', function($routeProvider) {
    $routeProvider.when('/home/:locale', {
      templateUrl: 'views/home.html',
      controller: 'HomeCtrl',
      dependencies: [ 'locale' ],
      resolve: {
        categories: [
          'GoteoApi', function(GoteoApi) {
            return GoteoApi.getCategories();
          }
        ],
        homeData: [
          '$route',
          'GoteoApi', function($route, GoteoApi) {
            var locale = $route.current.params.locale;
            return GoteoApi.getData('summary', locale, null, null);
          }
        ]
      }
    });
  }]);

  app.controller('HomeCtrl', [
    '$timeout',
    '$translate',
    '$scope',
    '$rootScope',
    '$routeParams',
    'categories',
    'homeData',
    function ($timeout, $translate, $scope, $rootScope, $routeParams, categories, homeData) {
      $rootScope.categories = categories;
      $rootScope.locale = $routeParams.locale;
      $rootScope.category = $rootScope.category || -1000;
      $rootScope.year = $rootScope.year || (moment().year() - 1);

      /**
       * Process data to be used in charts.
       */
{'fraction_non_alphanumeric': 0.1585708550782818, 'fraction_numerical': 0.004014452027298274, 'mean_word_length': 2.349462365591398, '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': '2206642', 'n_tokens_mistral': 744, 'n_tokens_neox': 731, 'n_words': 138}