<commit_before>'use strict';

formsAngular.controller('AnalysisCtrl', ['$rootScope', '$window', '$filter', '$scope', '$http', '$location', 'cssFrameworkService', 'routingService',
    function ($rootScope, $window, $filter, $scope, $http, $location, cssFrameworkService, routingService) {
        /*jshint newcap: false */
        var firstTime = true,
            pdfPlugIn = new ngGridPdfExportPlugin({inhibitButton: true}),
            csvPlugIn = new ngGridCsvExportPlugin({inhibitButton: true});
        /*jshint newcap: true */

        angular.extend($scope, routingService.parsePathFunc()($location.$$path));

        $scope.reportSchema = {
            columnDefs: []
        };
        $scope.gridOptions = {
            data: 'report',
            columnDefs: $scope.reportSchema.columnDefs,
            showColumnMenu: true,
            enableRowHeaderSelection: false,
            enableFiltering: false,
            showGridFooter: false,
            reallyShowFooter: false,   // this determines whether it is actually displayed or not
            showTotals: true,
            enableColumnResizing: true,
//        enableColumnReordering: true,
//        jqueryUIDraggable: true,
            footerRowHeight: 65,
            multiSelect: false,
            plugins: [pdfPlugIn, csvPlugIn],
            onRegisterApi: function (gridApi) {
                $scope.gridApi = gridApi;
                $scope.gridOptions.plugins.forEach(function (p) {
                    p.init($scope, gridApi.grid, null);
                });
                gridApi.selection.on.rowSelectionChanged($scope, function afterSelectionChange(rowItem) {
                    var url = $scope.reportSchema.drilldown;
                    if (url) {
                        url = routingService.buildUrl(url.replace(/\|.+?\|/g, function (match) {
                            var param = match.slice(1, -1),
                                isParamTest = /\((.+)\)/.exec(param);
                            if (isParamTest) {
                                var instructions = $scope.reportSchema.params[isParamTest[1]];
                                if (instructions) {
                                    $scope.param = $scope.record[isParamTest[1]];
                                    if (instructions.conversionExpression) {
                                        return $scope.$eval(instructions.conversionExpression);
                                    } else {
                                        return instructions.value;
                                    }
                                } else {
                                    return $scope.reportSchema.params[isParamTest[1]].value;
                                }
                            } else {
                                return rowItem.entity[param];
                            }
                        }));
                        window.location = url;
                    }
                });
            },
        };
        $scope.report = [];
<commit_msg>Try and get a clue about a sentry<commit_after>'use strict';

formsAngular.controller('AnalysisCtrl', ['$rootScope', '$window', '$filter', '$scope', '$http', '$location', 'cssFrameworkService', 'routingService',
    function ($rootScope, $window, $filter, $scope, $http, $location, cssFrameworkService, routingService) {
        /*jshint newcap: false */
        var firstTime = true,
            pdfPlugIn = new ngGridPdfExportPlugin({inhibitButton: true}),
            csvPlugIn = new ngGridCsvExportPlugin({inhibitButton: true});
        /*jshint newcap: true */

        angular.extend($scope, routingService.parsePathFunc()($location.$$path));

        $scope.reportSchema = {
            columnDefs: []
        };
        $scope.gridOptions = {
            data: 'report',
            columnDefs: $scope.reportSchema.columnDefs,
            showColumnMenu: true,
            enableRowHeaderSelection: false,
            enableFiltering: false,
            showGridFooter: false,
            reallyShowFooter: false,   // this determines whether it is actually displayed or not
            showTotals: true,
            enableColumnResizing: true,
//        enableColumnReordering: true,
//        jqueryUIDraggable: true,
            footerRowHeight: 65,
            multiSelect: false,
            plugins: [pdfPlugIn, csvPlugIn],
            onRegisterApi: function (gridApi) {
                $scope.gridApi = gridApi;
                $scope.gridOptions.plugins.forEach(function (p) {
                    p.init($scope, gridApi.grid, null);
                });
                gridApi.selection.on.rowSelectionChanged($scope, function afterSelectionChange(rowItem) {
                    var url = $scope.reportSchema.drilldown;
                    if (url) {
                        if (typeof url === 'string') {
                            url = routingService.buildUrl(url.replace(/\|.+?\|/g, function (match) {
                                var param = match.slice(1, -1),
                                    isParamTest = /\((.+)\)/.exec(param);
                                if (isParamTest) {
                                    var instructions = $scope.reportSchema.params[isParamTest[1]];
                                    if (instructions) {
                                        $scope.param = $scope.record[isParamTest[1]];
                                        if (instructions.conversionExpression) {
                                            return $scope.$eval(instructions.conversionExpression);
                                        } else {
                                            return instructions.value;
                                        }
                                    } else {
                                        return $scope.reportSchema.params[isParamTest[1]].value;
                                    }
                                } else {
                                    return rowItem.entity[param];
                                }
                            }));
                            window.location = url;
                        } else {
                            console.error('Was expecting drilldown to be string but it was ' + typeof url + ' (' + url + ')'); // trying to track down Sentry 3037641567
                        }
                    }
                });
            },
        };
        $scope.report = [];

{'fraction_non_alphanumeric': 0.10310712629463596, 'fraction_numerical': 0.0037100015458339775, 'mean_word_length': 1.2341160220994476, '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': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3904189', 'n_tokens_mistral': 1547, 'n_tokens_neox': 1443, 'n_words': 296}