<commit_before>var ApplicationsUI = (function(){
    'use strict';
    var tableID  = 'applications-table';
    var selector = '#' + tableID;
    var containerSelector = '#applications-ws-container';
    var columns  = ['name','permissions','last_used','action'];
    var messages = {
        no_apps: 'You have not granted access to any applications.',
        revoke_confirm: 'Are you sure that you want to permanently revoke access to application',
        revoke_access: 'Revoke access',
    };

    function createEmptyTable() {
        var header = [
                'Name',
                'Permissions',
                'Last Used',
                'Action',
            ].map(text.localize);
        var metadata = {
            id: tableID,
            cols: columns
        };
        var data = [];
        var $table = Table.createFlexTable(data,metadata,header);
        $table.appendTo(containerSelector);
        return $table;
    }

    function update(apps) {
        createEmptyTable();
        $('#loading').remove();
        if (!apps.length) {
            $(selector + ' tbody')
                .append($('<tr/>', {class: 'flex-tr'})
                    .append($('<td/>', {colspan: 7})
                        .append($('<p/>', {class: 'notice-msg center-text', text: text.localize(messages.no_apps)})
                        )
                    )
                );
            return;
        }
        Table.clearTableBody(tableID);
        Table.appendTableBody(tableID, apps, createRow);
        showLocalTimeOnHover('td.last_used');
    }

    function createRevokeButton(container, app) {
        var $buttonSpan = Button.createBinaryStyledButton();
        var $button = $buttonSpan.children('.button').first();
        $button.text(text.localize(messages.revoke_access));
        $button.on('click', function() {
            if (window.confirm(text.localize(messages.revoke_confirm) + ": '" + app.name + "'?")) {
                Applications.revokeApplication(app.id);
                container.css({ opacity: 0.5 });
            }
        });
        return $buttonSpan;
    }

    function createRow(app) {
        var row = [
            app.name,
            app.scopes.join(', '),
            app.last_used ? app.last_used.format('YYYY-MM-DD HH:mm:ss') : text.localize('Never'),
            '',
        ];
        var $row = Table.createFlexTableRow(row, columns, 'data');
        $row.children('.action').first().append(createRevokeButton($row, app));
        return $row[0];
    }

    function displayError(message) {
        $(containerSelector + ' .error-msg').text(message);
    }

    function init() {
        showLoadingImage($('<div/>', {id: 'loading'}).insertAfter('#applications-title'));
        var $title = $('#applications-title').children().first();
        var $desc  = $('#description');
        $title.text(text.localize($title.text()));
        $desc.text(text.localize($desc.text()));
    }

    function clean() {
        Table.clearTableBody(tableID);
        $(selector +'>tfoot').hide();
    }

    return {
        init: init,
        clean: clean,
        update: update,
        displayError: displayError
    };
}());<commit_msg>Remove unnecessary code<commit_after>var ApplicationsUI = (function(){
    'use strict';
    var tableID  = 'applications-table';
    var selector = '#' + tableID;
    var containerSelector = '#applications-ws-container';
    var columns  = ['name','permissions','last_used','action'];
    var messages = {
        no_apps: 'You have not granted access to any applications.',
        revoke_confirm: 'Are you sure that you want to permanently revoke access to application',
        revoke_access: 'Revoke access',
    };

    function createEmptyTable() {
        var header = [
                'Name',
                'Permissions',
                'Last Used',
                'Action',
            ].map(text.localize);
        var metadata = {
            id: tableID,
            cols: columns
        };
        var data = [];
        var $table = Table.createFlexTable(data,metadata,header);
        $table.appendTo(containerSelector);
        return $table;
    }

    function update(apps) {
        createEmptyTable();
        $('#loading').remove();
        if (!apps.length) {
            $(selector + ' tbody')
                .append($('<tr/>', {class: 'flex-tr'})
                    .append($('<td/>', {colspan: 7})
                        .append($('<p/>', {class: 'notice-msg center-text', text: text.localize(messages.no_apps)})
                        )
                    )
                );
            return;
        }
        Table.clearTableBody(tableID);
        Table.appendTableBody(tableID, apps, createRow);
        showLocalTimeOnHover('td.last_used');
    }

    function createRevokeButton(container, app) {
        var $buttonSpan = Button.createBinaryStyledButton();
        var $button = $buttonSpan.children('.button').first();
        $button.text(text.localize(messages.revoke_access));
        $button.on('click', function() {
            if (window.confirm(text.localize(messages.revoke_confirm) + ": '" + app.name + "'?")) {
                Applications.revokeApplication(app.id);
                container.css({ opacity: 0.5 });
            }
        });
        return $buttonSpan;
    }

    function createRow(app) {
        var row = [
            app.name,
            app.scopes.join(', '),
            app.last_used ? app.last_used.format('YYYY-MM-DD HH:mm:ss') : text.localize('Never'),
            '',
        ];
        var $row = Table.createFlexTableRow(row, columns, 'data');
        $row.children('.action').first().append(createRevokeButton($row, app));
        return $row[0];
    }

    function displayError(message) {
        $(containerSelector + ' .error-msg').text(message);
    }

    function init() {
        showLoadingImage($('<div/>', {id: 'loading'}).insertAfter('#applications-title'));
        var $title = $('#applications-title').children().first();
        var $desc  = $('#description');
        $title.text(text.localize($title.text()));
        $desc.text(text.localize($desc.text()));
    }

    function clean() {
        Table.clearTableBody(tableID);
    }

    return {
        init: init,
        clean: clean,
        update: update,
        displayError: displayError
    };
}());
{'fraction_non_alphanumeric': 0.1546310832025118, 'fraction_numerical': 0.0012558869701726845, 'mean_word_length': 1.9798877455565949, 'pattern_counts': {'":': 2, '<': 11, '<?xml version=': 0, '>': 12, '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': '6207717', 'n_tokens_mistral': 1798, 'n_tokens_neox': 1743, 'n_words': 330}