<commit_before>/**
 * Created by nitaip on 19/07/2015.
 */

function divBase(id, title, ignoreThead) {
    return $('<div><div id="' + (id || '') + '" class="tabs-pane active-pane" aria-hidden="false">' +
        ((title && !(localStorage["_hide_section_title"] == "true")) ? ('<div class="aui-inline-dialog-contents contents" style="width: 870px; max-height: 718px;"><h4>' + title + '</h4></div>') : '') +
        '<table class="aui paged-table pull-requests-table" id="inbox-pull-request-table-reviewer" data-last-updated="1437304041274" style="display: table;">' +
        (ignoreThead ? "" : '<thead><tr><th class="repository" scope="col">Repository</th><th class="title" scope="col">Title</th><th class="author" scope="col">Author</th><th class="reviewers" scope="col">Reviewers</th><th class="comment-count" scope="col"></th><th class="pull-request-list-task-count-column" title="" scope="col"></th><th class="source" scope="col">Source</th><th class="destination" scope="col">Destination</th><th class="updated" scope="col">Updated</th></tr></thead>') +
        '<tbody></tbody></table></div></div>');
}

function mkTD(pr, tdType) {
    switch (tdType) {
        case 'repository':
            return $(
                '<td class="repository">' +
                '<span class="aui-avatar aui-avatar-small aui-avatar-project">' +
                '<span class="aui-avatar-inner">' +
                '<img src="' + host(pr['fromRef']['repository']['project']['avatarUrl']) + '" alt="' + pr['fromRef']['repository']['project']['name'] + '">' +
                '</span>' +
                '</span>' +
                '<span title="apkMetadata"><a href="' + host(pr['fromRef']['repository']['link']['url']) + '">' + pr['fromRef']['repository']['name'] + '</a></span>' +
                '</td>'
            );
        case 'title':
            return $(
                '<td class="title">' +
                '<a title="' + pr['title'] + '" href="' + pr['link']['url'] + '">' + pr['title'] + '</a>' +
                '</td>');
        case 'author':
            return $(
                '<td class="author">' +
                '<div class="avatar-with-name" title="' + pr['author']['user']['displayName'] + '">' +
                '<span class="aui-avatar aui-avatar-small user-avatar" data-username="' + pr['author']['user']['name'] + '">' +
                '<span class="aui-avatar-inner"><img src="' + host(pr['author']['user']['avatarUrl']) + '" alt="' + pr['author']['user']['displayName'] + '"></span>' +
                '</span>' +
                '<a href="' + host(pr['author']['user']['link']['url']) + '" class="secondary-link">' + pr['author']['user']['displayName'] + '</a>' +
                '</div>' +
                '</td>');
        case 'reviewers':
            var td = $('<td class="reviewers"></td>');
            var revs = _.sortBy(pr['reviewers'],
                function (rev) {
                    return -1 * (rev.user.id);
                });
            revs.forEach(function (rev) {
                td.append($(
                    '<span class="aui-avatar aui-avatar-small aui-avatar-badged user-avatar ' +
                    (rev['approved'] ? '' : 'badge-hidden') + ' avatar-dimmed avatar-tooltip participant-item" data-username="' + rev['user']['name'] + '">' +
                    '<span class="aui-avatar-inner">' +
                    '<img src="' + host(rev['user']['avatarUrl']) + '" alt="' + rev['user']['displayName'] + '" original-title="' + rev['user']['displayName'] + '">' +
                    '</span>' +
                    '<span class="badge approved">?</span>' +
                    '</span>'
                ));
            });
            return td;

        case 'comment-count':
            var comments = pr['attributes']['commentCount'] || 0;
            var td_comm = $('<td class="comment-count"></td>');
            if (Number(comments)) {
                td_comm.append($(
                    '<span class="comment-count" title="' + comments + ' comments">' +
                    '<span class="aui-icon aui-icon-small aui-iconfont-comment">' + comments + ' comments</span>' + comments + '' +
                    '</span>'
                ));
            }
            return td_comm;

        case 'task-count':
            var tasks = pr['attributes']['openTaskCount'] || 0;
            var td_tasks = $('<td class="pull-request-list-task-count-column-value"></td>');
            if (Number(tasks)) {
                td_tasks.append($(
                    '<span class="replacement-placeholder" data-pull-request-id="' + pr['id'] + '" data-repository-id="' + pr['fromRef']['repository']['id'] + '" style="display: inline;">' +
                    '<span class="pr-list-open-task-count" title="' + tasks + ' open tasks">' +
                    '<span class="aui-icon aui-icon-small aui-iconfont-editor-task" data-pull-request-id="' + tasks + '">Open tasks: </span>' +
                    '<span class="task-count">' + tasks + '<span></span></span></span></span>'
                ));
            }
            return td_tasks;
<commit_msg>Improved tasks td to show how many total as well.<commit_after>/**
 * Created by nitaip on 19/07/2015.
 */

function divBase(id, title, ignoreThead) {
    return $('<div><div id="' + (id || '') + '" class="tabs-pane active-pane" aria-hidden="false">' +
        ((title && !(localStorage["_hide_section_title"] == "true")) ? ('<div class="aui-inline-dialog-contents contents" style="width: 870px; max-height: 718px;"><h4>' + title + '</h4></div>') : '') +
        '<table class="aui paged-table pull-requests-table" id="inbox-pull-request-table-reviewer" data-last-updated="1437304041274" style="display: table;">' +
        (ignoreThead ? "" : '<thead><tr><th class="repository" scope="col">Repository</th><th class="title" scope="col">Title</th><th class="author" scope="col">Author</th><th class="reviewers" scope="col">Reviewers</th><th class="comment-count" scope="col"></th><th class="pull-request-list-task-count-column" title="" scope="col"></th><th class="source" scope="col">Source</th><th class="destination" scope="col">Destination</th><th class="updated" scope="col">Updated</th></tr></thead>') +
        '<tbody></tbody></table></div></div>');
}

function mkTD(pr, tdType) {
    switch (tdType) {
        case 'repository':
            return $(
                '<td class="repository">' +
                '<span class="aui-avatar aui-avatar-small aui-avatar-project">' +
                '<span class="aui-avatar-inner">' +
                '<img src="' + host(pr['fromRef']['repository']['project']['avatarUrl']) + '" alt="' + pr['fromRef']['repository']['project']['name'] + '">' +
                '</span>' +
                '</span>' +
                '<span title="apkMetadata"><a href="' + host(pr['fromRef']['repository']['link']['url']) + '">' + pr['fromRef']['repository']['name'] + '</a></span>' +
                '</td>'
            );
        case 'title':
            return $(
                '<td class="title">' +
                '<a title="' + pr['title'] + '" href="' + pr['link']['url'] + '">' + pr['title'] + '</a>' +
                '</td>');
        case 'author':
            return $(
                '<td class="author">' +
                '<div class="avatar-with-name" title="' + pr['author']['user']['displayName'] + '">' +
                '<span class="aui-avatar aui-avatar-small user-avatar" data-username="' + pr['author']['user']['name'] + '">' +
                '<span class="aui-avatar-inner"><img src="' + host(pr['author']['user']['avatarUrl']) + '" alt="' + pr['author']['user']['displayName'] + '"></span>' +
                '</span>' +
                '<a href="' + host(pr['author']['user']['link']['url']) + '" class="secondary-link">' + pr['author']['user']['displayName'] + '</a>' +
                '</div>' +
                '</td>');
        case 'reviewers':
            var td = $('<td class="reviewers"></td>');
            var revs = _.sortBy(pr['reviewers'],
                function (rev) {
                    return -1 * (rev.user.id);
                });
            revs.forEach(function (rev) {
                td.append($(
                    '<span class="aui-avatar aui-avatar-small aui-avatar-badged user-avatar ' +
                    (rev['approved'] ? '' : 'badge-hidden') + ' avatar-dimmed avatar-tooltip participant-item" data-username="' + rev['user']['name'] + '">' +
                    '<span class="aui-avatar-inner">' +
                    '<img src="' + host(rev['user']['avatarUrl']) + '" alt="' + rev['user']['displayName'] + '" original-title="' + rev['user']['displayName'] + '">' +
                    '</span>' +
                    '<span class="badge approved">?</span>' +
                    '</span>'
                ));
            });
            return td;

        case 'comment-count':
            var comments = pr['attributes']['commentCount'] || 0;
            var td_comm = $('<td class="comment-count"></td>');
            if (Number(comments)) {
                td_comm.append($(
                    '<span class="comment-count" title="' + comments + ' comments">' +
                    '<span class="aui-icon aui-icon-small aui-iconfont-comment">' + comments + ' comments</span>' + comments + '' +
                    '</span>'
                ));
            }
            return td_comm;

        case 'task-count':
            var tasks = Number(pr['attributes']['openTaskCount'] || 0);
            var resolvedTasks = Number(pr['attributes']['resolvedTaskCount'] || 0);
            var totTasks = tasks + resolvedTasks;
            var td_tasks = $('<td class="pull-request-list-task-count-column-value"></td>');
            if (Number(tasks)) {
                td_tasks.append($(
                    '<span class="replacement-placeholder" data-pull-request-id="' + pr['id'] + '" data-repository-id="' + pr['fromRef']['repository']['id'] + '" style="display: inline;">' +
                    '<span class="pr-list-open-task-count" title="' + tasks + ' open tasks">' +
                    '<span class="aui-icon aui-icon-small aui-iconfont-editor-task" data-pull-request-id="' + tasks + '">Resolved/Total tasks:</span>' +
                    '<span class="task-count">' + resolvedTasks + ' / ' + totTasks + '<span></span></span></span></span>'
                ));
            }
            return td_tasks;

{'fraction_non_alphanumeric': 0.22629558541266795, 'fraction_numerical': 0.006238003838771593, 'mean_word_length': 2.2104128157732594, 'pattern_counts': {'":': 0, '<': 177, '<?xml version=': 0, '>': 177, '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': '1742461', 'n_tokens_mistral': 3131, 'n_tokens_neox': 3022, 'n_words': 513}