<commit_before>(function(window, location, undef) {
  var root   = location.protocol + "//" + location.host,
      apiKey = window.AIRBRAKE_API_KEY;
  
  function xmlNode(nodeName, attributes, nodeValue) {
    attributes = attributes ? " " + attributes : "";
    return "<" + nodeName + attributes +  ">" + nodeValue + "</" + nodeName + ">";
  }
  
  function escapeText(text) {
    return (text + "").replace(/[&<>'"]/g, function(match) {
      return "&#" + match.charCodeAt() + ";";
    });
  }
  
  function getXML(message, file, line) {
    file = file.replace(root, "[PROJECT ROOT]");
    return '<?xml version="1.0" encoding="UTF-8"?>' +
            xmlNode("notice", 'version="2.0"',
              xmlNode("api-key",  undef, apiKey) +
              xmlNode("notifier", undef,
                xmlNode("name",     undef, "hoptoad_notifier_js")   +
                xmlNode("version",  undef, "0.1.0")                 +
                xmlNode("url",      undef, "http://hoptoadapp.com")
              ) +
              xmlNode("error",    undef, 
                xmlNode("class",      undef, "Error")    +
                xmlNode("message",    undef, escapeText(message))    +
                xmlNode("backtrace",  undef, '<line method="" file="' + escapeText(file) + '" number="' + escapeText(line) + '" />')
              ) +
              xmlNode("request",  undef,
                xmlNode("component",  undef, "frontend")    +
                xmlNode("action",     undef, "javascript")  +
                xmlNode("url",        undef, location.href) +
                xmlNode("cgi-data",   undef, 
                  xmlNode("var", 'key="HTTP_USER_AGENT"', navigator.userAgent) +
                  xmlNode("var", 'key="HTTP_REFERER"',    document.referrer)
                )
              ) +
              xmlNode("server-environment", undef,
                xmlNode("project-root",     undef, root) +
                xmlNode("environment-name", undef, "production")
              )
            );
  }
  
  window.onerror = (window.Airbrake = {}).notify = function(message, file, line) {
    if (apiKey) {
      new Image().src = "http://hoptoadapp.com/notifier_api/v2/notices?data=" + escape(getXML(message, file, line));
    }
  };
})(this, location);<commit_msg>Use airbrakeapp.com instead of hoptoadapp.com and use https<commit_after>(function(window, location, undef) {
  var root   = location.protocol + "//" + location.host,
      apiKey = window.AIRBRAKE_API_KEY;
  
  function xmlNode(nodeName, attributes, nodeValue) {
    attributes = attributes ? " " + attributes : "";
    return "<" + nodeName + attributes +  ">" + nodeValue + "</" + nodeName + ">";
  }
  
  function escapeText(text) {
    return (text + "").replace(/[&<>'"]/g, function(match) {
      return "&#" + match.charCodeAt() + ";";
    });
  }
  
  function getXML(message, file, line) {
    file = file.replace(root, "[PROJECT ROOT]");
    return '<?xml version="1.0" encoding="UTF-8"?>' +
            xmlNode("notice", 'version="2.0"',
              xmlNode("api-key",  undef, apiKey) +
              xmlNode("notifier", undef,
                xmlNode("name",     undef, "hoptoad_notifier_js")   +
                xmlNode("version",  undef, "0.1.0")                 +
                xmlNode("url",      undef, "http://hoptoadapp.com")
              ) +
              xmlNode("error",    undef, 
                xmlNode("class",      undef, "Error")    +
                xmlNode("message",    undef, escapeText(message))    +
                xmlNode("backtrace",  undef, '<line method="" file="' + escapeText(file) + '" number="' + escapeText(line) + '" />')
              ) +
              xmlNode("request",  undef,
                xmlNode("component",  undef, "frontend")    +
                xmlNode("action",     undef, "javascript")  +
                xmlNode("url",        undef, location.href) +
                xmlNode("cgi-data",   undef, 
                  xmlNode("var", 'key="HTTP_USER_AGENT"', navigator.userAgent) +
                  xmlNode("var", 'key="HTTP_REFERER"',    document.referrer)
                )
              ) +
              xmlNode("server-environment", undef,
                xmlNode("project-root",     undef, root) +
                xmlNode("environment-name", undef, "production")
              )
            );
  }
  
  window.onerror = (window.Airbrake = {}).notify = function(message, file, line) {
    if (apiKey) {
      new Image().src = "https://airbrakeapp.com/notifier_api/v2/notices?data=" + escape(getXML(message, file, line));
    }
  };
})(this, location);
{'fraction_non_alphanumeric': 0.16804527644754028, 'fraction_numerical': 0.00391815411406182, 'mean_word_length': 1.930484693877551, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 2, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 44}, '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': '854677', 'n_tokens_mistral': 1436, 'n_tokens_neox': 1357, 'n_words': 238}