<commit_before>var TargetsCollection = require('./TargetsCollection');

var app = angular.module('app', ['ngAnimate', 'ngMaterial']);

app.filter('regex', function() {
    return function(input, field, regex) {
        var patt = new RegExp(regex);
        var out = [];

        if(input) {
            for (var i = 0; i < input.length; i++){
                if(patt.test(input[i][field])) {
                    out.push(input[i]);
                }
            }
        }

        return out;
    };
});

app.directive('devtools', function() {

    return {
        restrict: 'E',
        replace: true,
        template: '<div class="devtools-wrapper"><iframe src="{{src}}"></iframe></div>',
        scope: {
            'src': '@',
        },
        link: function ($scope, element, attr) {

        }
    }

});

app.controller('home', function ($scope, $http, $location) {

    $scope.filter = '^page$';
    $scope.targetsFilterSelectedIndex = 1;
    $scope.devtoolsUrl = '';

    $scope.targets = new TargetsCollection();

    setupMenubars();

    $scope.connect = function(target) {

        if(!target.devtoolsFrontendUrl) {
            return;
        }

        var webSocketUrl = target.webSocketDebuggerUrl.replace(/(ws|wss)\:\/\//, '');

        $scope.devtoolsUrl = 'devtools/front_end/inspector.html?ws=' + webSocketUrl;
    }

    $scope.setTargetFilter = function(filter) {

        switch(filter) {<commit_msg>Throw exception rather then sliently returning<commit_after>var TargetsCollection = require('./TargetsCollection');

var app = angular.module('app', ['ngAnimate', 'ngMaterial']);

app.filter('regex', function() {
    return function(input, field, regex) {
        var patt = new RegExp(regex);
        var out = [];

        if(input) {
            for (var i = 0; i < input.length; i++){
                if(patt.test(input[i][field])) {
                    out.push(input[i]);
                }
            }
        }

        return out;
    };
});

app.directive('devtools', function() {

    return {
        restrict: 'E',
        replace: true,
        template: '<div class="devtools-wrapper"><iframe src="{{src}}"></iframe></div>',
        scope: {
            'src': '@',
        },
        link: function ($scope, element, attr) {

        }
    }

});

app.controller('home', function ($scope, $http, $location) {

    $scope.filter = '^page$';
    $scope.targetsFilterSelectedIndex = 1;
    $scope.devtoolsUrl = '';

    $scope.targets = new TargetsCollection();

    setupMenubars();

    $scope.connect = function(target) {

        if(!target.devtoolsFrontendUrl) {
            throw new Error("devtoolsFrontendUrl is missing");
        }

        var webSocketUrl = target.webSocketDebuggerUrl.replace(/(ws|wss)\:\/\//, '');

        $scope.devtoolsUrl = 'devtools/front_end/inspector.html?ws=' + webSocketUrl;
    }

    $scope.setTargetFilter = function(filter) {

        switch(filter) {
{'fraction_non_alphanumeric': 0.16666666666666666, 'fraction_numerical': 0.0013605442176870747, 'mean_word_length': 2.210698689956332, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '1482537', 'n_tokens_mistral': 912, 'n_tokens_neox': 871, 'n_words': 163}