<commit_before>'use strict';

var app = angular.module('testReport.launch', [
    'ngRoute',
    'ngTable',
    'ngResource',
    'cfp.hotkeys',
    'testReportServices',
    'testReportFilters',
    'ngSanitize'
]);

app.config(['$routeProvider',
    function ($routeProvider) {
        $routeProvider.when('/launch/:launchId', {
            templateUrl: '/static/app/partials/launch/launch.html',
            controller: 'LaunchCtrl'
        });
    }
]);

app.directive('goClick', function ($location) {
    return function (scope, element, attrs) {
        var path;

        attrs.$observe('goClick', function (val) {
            path = val;
        });

        element.bind('click', function () {
            scope.$apply(function () {
                $location.path(path);
            });
        });
    };
});

app.controller('LaunchCtrl', ['$scope', '$rootScope', '$routeParams', '$filter', '$timeout', 'ngTableParams', 'hotkeys', 'appConfig', 'TestResult', 'Launch', 'Task', 'Comment', 'Bug', 'SortLaunchItems', 'TestPlan',
    function ($scope, $rootScope, $routeParams, $filter, $timeout, ngTableParams, hotkeys, appConfig, TestResult, Launch, Task, Comment, Bug, SortLaunchItems, TestPlan) {
        var initialized = false;

        Launch.get({ launchId: $routeParams.launchId }, function (launch) {
            if($rootScope.getActiveProject() === null) {
                TestPlan.get({'testPlanId': launch.test_plan}, function(testplan) {
                    $rootScope.selectProject(testplan.project);
                });
            }
            $scope.launch = launch;
            if (!$scope.launch.duration) {
                $scope.launch.duration = parseInt((Date.parse(launch.finished) - Date.parse(launch.created)) / (1000 * 60));
            } else {
                $scope.launch.duration = parseInt($scope.launch.duration / 60);
            }
            $scope.getTasksDetails($scope.launch.tasks);
        });

        $scope.jira = JIRA_INTEGRATION;
        $scope.finished = true;
        $scope.modalSuite = '';
        $scope.modalName = '';
        $scope.modalBody = '';
        $scope.modalId = 0;
        $scope.state = appConfig.TESTRESULT_FAILED;
        $scope.data = [];
        $scope.dataGroup = [];
        $scope.index = 0;
        $scope.tasks = [];
        $scope.form_comment = '';
        $scope.comment_disabled = false;
        $scope.bugs = [];
        $scope.timers = [];
        $scope.currentTask = null;
        $scope.terminateButtonActive = true;
        $scope.terminateMessage = null;

        $scope.$watch('regExp', function (text) {
            var pattern = '/(?:)/';
            if (text) {
                //escape special symbols to avoid problem with regexp
                pattern = text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
            }
            var regexp = new RegExp(pattern, 'm');
            _.each(_.reduceRight($scope.data, function(a, b) { return a.concat(b); }), function (item) {
                item.hidden = false;
                if (!regexp.test(item.failure_reason)) {
                    item.hidden = true;
                }
            });
        });

        $scope.addBug = function () {
            var bug = new Bug();
            bug.externalId = $scope.bugId;
            bug.regexp = $scope.regExp;
            Bug.save(bug, function (result) {
                $scope.bugId = null;
                $scope.regExp = null;
                $scope.apiErrors = null;
                $scope.updateBugBinding();
                $scope.tableParams.reload();
            }, function (result) {
                $scope.apiErrors = result.data.detail;<commit_msg>show message for not existent jira issue<commit_after>'use strict';

var app = angular.module('testReport.launch', [
    'ngRoute',
    'ngTable',
    'ngResource',
    'cfp.hotkeys',
    'testReportServices',
    'testReportFilters',
    'ngSanitize'
]);

app.config(['$routeProvider',
    function ($routeProvider) {
        $routeProvider.when('/launch/:launchId', {
            templateUrl: '/static/app/partials/launch/launch.html',
            controller: 'LaunchCtrl'
        });
    }
]);

app.directive('goClick', function ($location) {
    return function (scope, element, attrs) {
        var path;

        attrs.$observe('goClick', function (val) {
            path = val;
        });

        element.bind('click', function () {
            scope.$apply(function () {
                $location.path(path);
            });
        });
    };
});

app.controller('LaunchCtrl', ['$scope', '$rootScope', '$routeParams', '$filter', '$timeout', 'ngTableParams', 'hotkeys', 'appConfig', 'TestResult', 'Launch', 'Task', 'Comment', 'Bug', 'SortLaunchItems', 'TestPlan',
    function ($scope, $rootScope, $routeParams, $filter, $timeout, ngTableParams, hotkeys, appConfig, TestResult, Launch, Task, Comment, Bug, SortLaunchItems, TestPlan) {
        var initialized = false;

        Launch.get({ launchId: $routeParams.launchId }, function (launch) {
            if($rootScope.getActiveProject() === null) {
                TestPlan.get({'testPlanId': launch.test_plan}, function(testplan) {
                    $rootScope.selectProject(testplan.project);
                });
            }
            $scope.launch = launch;
            if (!$scope.launch.duration) {
                $scope.launch.duration = parseInt((Date.parse(launch.finished) - Date.parse(launch.created)) / (1000 * 60));
            } else {
                $scope.launch.duration = parseInt($scope.launch.duration / 60);
            }
            $scope.getTasksDetails($scope.launch.tasks);
        });

        $scope.jira = JIRA_INTEGRATION;
        $scope.finished = true;
        $scope.modalSuite = '';
        $scope.modalName = '';
        $scope.modalBody = '';
        $scope.modalId = 0;
        $scope.state = appConfig.TESTRESULT_FAILED;
        $scope.data = [];
        $scope.dataGroup = [];
        $scope.index = 0;
        $scope.tasks = [];
        $scope.form_comment = '';
        $scope.comment_disabled = false;
        $scope.bugs = [];
        $scope.timers = [];
        $scope.currentTask = null;
        $scope.terminateButtonActive = true;
        $scope.terminateMessage = null;

        $scope.$watch('regExp', function (text) {
            var pattern = '/(?:)/';
            if (text) {
                //escape special symbols to avoid problem with regexp
                pattern = text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
            }
            var regexp = new RegExp(pattern, 'm');
            _.each(_.reduceRight($scope.data, function(a, b) { return a.concat(b); }), function (item) {
                item.hidden = false;
                if (!regexp.test(item.failure_reason)) {
                    item.hidden = true;
                }
            });
        });

        $scope.addBug = function () {
            var bug = new Bug();
            bug.externalId = $scope.bugId;
            bug.regexp = $scope.regExp;
            Bug.save(bug, function (result) {
                $scope.bugId = null;
                $scope.regExp = null;
                $scope.apiErrors = null;
                $scope.updateBugBinding();
                $scope.tableParams.reload();
            }, function (result) {
                $scope.apiErrors = result.data.message;
{'fraction_non_alphanumeric': 0.15800924666847974, 'fraction_numerical': 0.0027196083763937995, 'mean_word_length': 1.899093417422152, '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': '2539499', 'n_tokens_mistral': 2151, 'n_tokens_neox': 2061, 'n_words': 377}