{"size": 1905, "ext": "js", "max_stars_repo_path": "doc/upstream-training/source/_static/custom.js", "max_stars_repo_name": "liangbangke/OpenStack", "max_stars_repo_stars_event_min_datetime": "2015-01-29T20:10:51.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-01T09:07:44.000Z", "max_issues_repo_path": "doc/upstream-training/source/_static/custom.js", "max_issues_repo_name": "liangbangke/OpenStack", "max_issues_repo_issues_event_min_datetime": "2015-10-01T13:24:27.000Z", "max_issues_repo_issues_event_max_datetime": "2015-10-01T13:24:27.000Z", "max_forks_repo_path": "doc/upstream-training/source/_static/custom.js", "max_forks_repo_name": "liangbangke/OpenStack", "max_forks_repo_forks_event_min_datetime": "2015-01-19T18:36:57.000Z", "max_forks_repo_forks_event_max_datetime": "2020-09-03T01:32:42.000Z"}
{"max_stars_count": 63, "max_issues_count": 1, "max_forks_count": 39, "avg_line_length": 37.3529411765, "max_line_length": 76, "alphanum_fraction": 0.6041994751}
function logABug() {
    var lineFeed = "%0A";

    // generate title
    var headings = document.getElementsByTagName('h2');
    var bugTitle;
    if (headings.length > 0) {
        bugTitle = headings[headings.length-1].innerHTML
                   + " in Upstream Training";
    } else {
        bugTitle = document.title + " in Upstream Training";
    }
    // remove unnecessary anchor tag
    bugTitle = bugTitle.replace(/<a [^>]*>/, '');
    bugTitle = bugTitle.replace(/<\/a>/, '');

    // generate location with page number
    var location = window.location.href;
    if (location.indexOf("#") > 0) {
        // remove static page number at the point direct access
        location = location.substring(0,location.indexOf("#"));
    }
    var pageNum  = headings.length + 1;

    // generate bug report link URL
    var bugLink  = "https://bugs.launchpad.net/openstack-training-guides/"
                   + "+filebug?field.title=" + encodeURIComponent(bugTitle)
                   + "&field.comment=" + lineFeed + lineFeed
                   + "----------------------------------------" + lineFeed
                   + "Title: " + encodeURIComponent(bugTitle) + lineFeed
                   + "URL: " + encodeURIComponent(location + "#" + pageNum);

    // generate bug report link
    var elementI = document.createElement('i');
    var attrC1  = document.createAttribute('class');
    attrC1.value  = 'fa fa-bug';
    elementI.setAttributeNode(attrC1);

    var elementA = document.createElement('a');
    var attrC2  = document.createAttribute('class');
    var attrH   = document.createAttribute('href');
    attrC2.value  = 'logabug';
    attrH.value = bugLink;
    elementA.setAttributeNode(attrC2);
    elementA.setAttributeNode(attrH);
    elementA.appendChild(elementI);

    var slides  = document.getElementsByTagName('article');
    slides[slides.length-1].appendChild(elementA);
}
