<commit_before>$(document).ready(function() {
    /* show / hide NOSCRIPT support */
    $('.bug_ids_extra').hide();
    $('.bug_ids_more').show();

    var query_string = "";
    $('.bug-link').each(function(i, v) {
      query_string += v.innerHTML + ",";
    });

    if (query_string) {
      $.ajax({
        url: "/buginfo/bug?id=" + query_string + "&include_fields=summary,status,id,resolution",
        dataType: 'json',
        success: function(data) {
          var bugTable = {};
          if (data.bugs) {
              $.each(data.bugs, function(i, v) {
                bugTable[v.id] = v;
              });
          }
          $('.bug-link').each(function(i, v) {
            var bug = bugTable[v.innerHTML];
            if (bug) {
              $(this).attr("title", bug.status + " " + bug.resolution + " " + bug.summary);
              if(bug.resolution.length > 0 &&
                 !(bug.resolution in ['UNCONFIRMED','NEW','ASSIGNED','REOPENED'])) {
                $(this).addClass("strike");
              }
            }
          });
          $('.bug_ids_expanded .bug-link').each(function(i, v) {
            var bug = bugTable[v.innerHTML],
                current;
            if (bug) {
              current = $(this).html();
              $(this).after(" " + bug.status + " " + bug.resolution + " " + bug.summary);
            }
          });
        }
      });
    }

    $('.bug_ids_more').hover(function() {
        var inset = 10,
        cell = $(this),
        bugList = cell.find('.bug_ids_expanded_list');

        bugList.css({
            top: cell.position().top - inset,
            left: cell.position().left - (bugList.width() + inset)
        }).toggle();
    });
});<commit_msg>remove duplicates from array and batch bugzilla api calls fixes bug 732244<commit_after>$(document).ready(function() {
    /* show / hide NOSCRIPT support */
    $('.bug_ids_extra').hide();
    $('.bug_ids_more').show();
    
    var bugzillaIds = [],
    scrubbedIds = [];
    $('.bug-link').each(function(i, v) {
        bugzillaIds.push(v.innerHTML);
    });
    //remove duplicates from array
    scrubbedIds = jQuery.unique(bugzillaIds);

    var batchSize = 100,
    scrubbedIdsLength = scrubbedIds.length,
    updateBugStatus = function(bugzilla_ids) {
        $.ajax({
            url: "/buginfo/bug?id=" + bugzilla_ids + "&include_fields=summary,status,id,resolution",
            dataType: 'json',
            success: function(data) {
                var bugTable = {};
                if (data.bugs) {
                    $.each(data.bugs, function(i, v) {
                        bugTable[v.id] = v;
                    });
                }

                $('.bug-link').each(function(i, v) {
                    var bug = bugTable[v.innerHTML];
                    if (bug) {
                        $(this).attr("title", bug.status + " " + bug.resolution + " " + bug.summary);

                        if(bug.resolution.length > 0 &&
                            !(bug.resolution in ['UNCONFIRMED','NEW','ASSIGNED','REOPENED'])) {
                            $(this).addClass("strike");
                        }
                    }
                });

                $('.bug_ids_expanded .bug-link').each(function(i, v) {
                    var bug = bugTable[v.innerHTML],
                    current;

                    if (bug) {
                        current = $(this).html();
                        $(this).after(" " + bug.status + " " + bug.resolution + " " + bug.summary);
                    }
                });
            }
        });
    };

    if (scrubbedIdsLength) {
        var startIndex = 0,
        endIndex = 1;
        
        while(startIndex < scrubbedIdsLength) {
            endIndex += batchSize;
            updateBugStatus(scrubbedIds.slice(startIndex, endIndex));
            startIndex = endIndex;
        }
    }

    $('.bug_ids_more').hover(function() {
        var inset = 10,
        cell = $(this),
        bugList = cell.find('.bug_ids_expanded_list');
    
        bugList.css({
            top: cell.position().top - inset,
            left: cell.position().left - (bugList.width() + inset)
        }).toggle();
    });
});
{'fraction_non_alphanumeric': 0.16295594504973945, 'fraction_numerical': 0.004026527711984841, 'mean_word_length': 1.4652656158785755, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, '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': '4103168', 'n_tokens_mistral': 1274, 'n_tokens_neox': 1186, 'n_words': 201}