<commit_before>define(['jquery', 'underscore', 'appearanceUtils', 'debug'], function($, _, utils, debug) {
   var log = debug('indicators');
   var signatureStatus = function(pull, node, type, required, signatures) {
         var signatureMark = function() {
            return $('<i>').addClass('signature fa fa-check-circle');
         };

         var signatureValidMark = function() {
            return signatureMark().addClass('signature-valid');
         };

         var mySignatureValidMark = function() {
            return signatureMark().addClass('signature-valid-mine');
         };

         var signatureInvalidatedMark = function() {
            return signatureMark().addClass('signature-invalid');
         };

         var mySignatureInvalidatedMark = function() {
            return signatureMark().addClass('signature-invalid-mine');
         };

         var signatureDescription = function(pull, signature) {
            var sig = $('<tr>').addClass('sig-row');
            var avatarCell = $('<td>').
             addClass('sig-avatar').
             append(utils.getAvatar(signature.data.user.id));
            var info = $('<td>').addClass('sig-info');

            var date = new Date(signature.data.created_at);
            info.text(utils.formatDate(date) + ' by ' +
             signature.data.user.login);

            return sig.append(avatarCell).append(info);
         };

         var validSignatureDescription = function(pull, signature) {
            return signatureDescription(pull, signature).
             addClass('signature-valid-listing');
         };

         var myValidSignatureDescription = function(pull, signature) {
            return signatureDescription(pull, signature).
             addClass('signature-valid-listing-mine');
         };

         var invalidSignatureDescription = function(pull, signature) {
            return signatureDescription(pull, signature).
             addClass('signature-invalid-listing');
         };

         var myInvalidSignatureDescription = function(pull, signature) {
            return invalidSignatureDescription(pull, signature).
             addClass('signature-invalid-listing-mine');
         };

         var signatureSeparator = function(message) {
            var text = $('<p>').text(message);
            var border = $('<div>').
             addClass("signature-separator").
             append(text);
            var cell = $('<td>').
             attr('colspan', 2).
             append(border).
             addClass('signature-divider');

            return $('<tr>').append(cell);
         };

         if (required === 0) {
            // Handle no-signature situation
            node.addClass('full-valid').
             append(signatureValidMark()).
             tooltip({'title': 'No ' + type + ' required!'});
            log("required === 0");
         } else {
            // container is a div that won't be inserted; it's just used to get the
            // HTML for the tooltip
            var tipper = $('<table>');
            var container = $('<div>').append(tipper);

            var currentSignatures = signatures.current;
            var oldSignatures = signatures.old;
            var userSignature = signatures.user;

            var tallies = valid = invalid = myValid = myInvalid = 0;

            log("Tallies so far (should be 0):", tallies);
            log("Currently-valid signatures:", currentSignatures);<commit_msg>jshint: clean up global variables<commit_after>define(['jquery', 'underscore', 'appearanceUtils', 'debug'], function($, _, utils, debug) {
   var log = debug('indicators');
   var signatureStatus = function(pull, node, type, required, signatures) {
         var signatureMark = function() {
            return $('<i>').addClass('signature fa fa-check-circle');
         };

         var signatureValidMark = function() {
            return signatureMark().addClass('signature-valid');
         };

         var mySignatureValidMark = function() {
            return signatureMark().addClass('signature-valid-mine');
         };

         var signatureInvalidatedMark = function() {
            return signatureMark().addClass('signature-invalid');
         };

         var mySignatureInvalidatedMark = function() {
            return signatureMark().addClass('signature-invalid-mine');
         };

         var signatureDescription = function(pull, signature) {
            var sig = $('<tr>').addClass('sig-row');
            var avatarCell = $('<td>').
             addClass('sig-avatar').
             append(utils.getAvatar(signature.data.user.id));
            var info = $('<td>').addClass('sig-info');

            var date = new Date(signature.data.created_at);
            info.text(utils.formatDate(date) + ' by ' +
             signature.data.user.login);

            return sig.append(avatarCell).append(info);
         };

         var validSignatureDescription = function(pull, signature) {
            return signatureDescription(pull, signature).
             addClass('signature-valid-listing');
         };

         var myValidSignatureDescription = function(pull, signature) {
            return signatureDescription(pull, signature).
             addClass('signature-valid-listing-mine');
         };

         var invalidSignatureDescription = function(pull, signature) {
            return signatureDescription(pull, signature).
             addClass('signature-invalid-listing');
         };

         var myInvalidSignatureDescription = function(pull, signature) {
            return invalidSignatureDescription(pull, signature).
             addClass('signature-invalid-listing-mine');
         };

         var signatureSeparator = function(message) {
            var text = $('<p>').text(message);
            var border = $('<div>').
             addClass("signature-separator").
             append(text);
            var cell = $('<td>').
             attr('colspan', 2).
             append(border).
             addClass('signature-divider');

            return $('<tr>').append(cell);
         };

         if (required === 0) {
            // Handle no-signature situation
            node.addClass('full-valid').
             append(signatureValidMark()).
             tooltip({'title': 'No ' + type + ' required!'});
            log("required === 0");
         } else {
            // container is a div that won't be inserted; it's just used to get the
            // HTML for the tooltip
            var tipper = $('<table>');
            var container = $('<div>').append(tipper);

            var currentSignatures = signatures.current;
            var oldSignatures = signatures.old;
            var userSignature = signatures.user;

            var tallies = 0,
                valid = 0,
                invalid = 0,
                myValid = 0,
                myInvalid = 0;

            log("Tallies so far (should be 0):", tallies);
            log("Currently-valid signatures:", currentSignatures);
{'fraction_non_alphanumeric': 0.1323151584356266, 'fraction_numerical': 0.0019982871824150727, 'mean_word_length': 1.9982884039366708, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '1666599', 'n_tokens_mistral': 1720, 'n_tokens_neox': 1625, 'n_words': 377}