<commit_before>// JavaScript code for the index.html template.
$(document).ready(function() {
    $('#li-home').addClass('active');
    $('body').tooltip({
        'selector': '[rel=tooltip]',
        'placement': 'auto'
    });

    $('.clickable-table tbody').on("click", "tr", function() {
        var url = $(this).data('url');
        if (url) {
            window.location = url;
        }
    });
});

$(document).ready(function() {
    function countFailedDefconfigs(data) {
        var i = 0,
            len = data.length,
            job, kernel;

        for (i; i < len; i++) {
            job = data[i].job;
            kernel = data[i].kernel;

            $.ajax({
                'url': '/_ajax/count/defconfig',
                'traditional': true,
                'dataType': 'json',
                'data': {
                    'status': 'FAIL',
                    'job': job,
                    'kernel': kernel
                },
                'dataFilter': function(data, type) {
                    if (type === 'json') {
                        return JSON.parse(data).result;
                    }
                    return data;
                }
            }).done(function(data) {
                $('#fail-count' + (i - 1)).empty().append(data.count);
            });
        }
    }

    function countFailCallback() {
        $('.fail-badge').each(function() {
            $(this).empty().append('&infin;');
        });
    }

    $.when(
        $.ajax({
            'url': '/_ajax/defconf',
            'traditional': true,
            'dataType': 'json',
            'context': $('#failed-builds-body'),
            'data': {
                'aggregate': 'kernel',
                'limit': 5,
                'status': 'FAIL',
                'sort': 'created_on',
                'sort_order': -1,
                'date_range': 15,
                'field': ['job', 'kernel', 'metadata', 'created_on']
            },<commit_msg>index.html: Fix failed badge count.<commit_after>// JavaScript code for the index.html template.
$(document).ready(function() {
    $('#li-home').addClass('active');
    $('body').tooltip({
        'selector': '[rel=tooltip]',
        'placement': 'auto'
    });

    $('.clickable-table tbody').on("click", "tr", function() {
        var url = $(this).data('url');
        if (url) {
            window.location = url;
        }
    });
});

$(document).ready(function() {
    function countFailedDefconfigs(data) {
        var i = 0,
            len = data.length,
            deferredCalls = new Array(len);

        for (i; i < len; i++) {
            deferredCalls[i] = $.ajax({
                'url': '/_ajax/count/defconfig',
                'traditional': true,
                'dataType': 'json',
                'data': {
                    'status': 'FAIL',
                    'job': data[i].job,
                    'kernel': data[i].kernel
                },
                'dataFilter': function(data, type) {
                    if (type === 'json') {
                        return JSON.parse(data).result;
                    }
                    return data;
                }
            });
        }

        $.when.apply($, deferredCalls).then(function() {
            var i = 0,
                len = arguments.length,
                count = '&infin;';

            for (i; i < len; i++) {
                if (arguments[i] !== null) {
                    count = arguments[i][0].count;
                }
                $('#fail-count' + i).empty().append(count);
            }
        });
    }

    function countFailCallback() {
        $('.fail-badge').each(function() {
            $(this).empty().append('&infin;');
        });
    }

    $.when(
        $.ajax({
            'url': '/_ajax/defconf',
            'traditional': true,
            'dataType': 'json',
            'context': $('#failed-builds-body'),
            'data': {
                'aggregate': 'kernel',
                'limit': 5,
                'status': 'FAIL',
                'sort': 'created_on',
                'sort_order': -1,
                'date_range': 15,
                'field': ['job', 'kernel', 'metadata', 'created_on']
            },
{'fraction_non_alphanumeric': 0.17541371158392435, 'fraction_numerical': 0.0030732860520094564, 'mean_word_length': 1.2374405076679005, 'pattern_counts': {'":': 0, '<': 6, '<?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': '2641421', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1144, 'n_words': 227}