<commit_before>//check load speed of website
exports.name = "load-speed";
exports.category = "performance";
exports.check = function (checker) {
	var sink = checker.sink;
	if (checker.webAppData.pageSpeed <= 1000) {
		sink.emit('ok', checker.l10n.message(checker.options.lang, this.category, this.name, "ok"));
		sink.emit('done');
	}
	else if (checker.webAppData.pageSpeed > 1000 && checker.webAppData.pageSpeed <= 2000) {
		sink.emit('warning', checker.l10n.message(checker.options.lang, this.category, this.name, "warning"));
		sink.emit('done');
	}
	else if (checker.webAppData.pageSpeed > 2000) {
		sink.emit('err', checker.l10n.message(checker.options.lang, this.category, this.name, "err"));
		sink.emit('done');
	}
}<commit_msg>Add issue template in load-speed check<commit_after>//check load speed of website
var ejs = require('ejs');
var path = require('path');
var fs = require('fs');
exports.name = "load-speed";
exports.category = "performance";
exports.check = function (checker) {
	var sink = checker.sink;
	if (checker.webAppData.pageSpeed <= 1500) {
		sink.emit('ok', checker.l10n.message(checker.options.lang, this.category, this.name, "ok"));
		sink.emit('done');
	}
	else if (checker.webAppData.pageSpeed > 1500) {
		sendIssue(sink, "page-load-slowly", this.name, this.category, checker.webAppData.pageSpeed);
	}
}

function sendIssue(sink, key, name, category, data) {
    var str = fs.readFileSync(path.join(__dirname, '/../../issues/' +category+ '/' +name+ '/' +key+ '.ejs'), 'utf8');
    if(!data) var data = {};
    sink.emit('err', ejs.render(str, data));
    sink.emit('done');
}
{'fraction_non_alphanumeric': 0.18679950186799502, 'fraction_numerical': 0.02054794520547945, 'mean_word_length': 4.7188612099644125, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '6942973', 'n_tokens_mistral': 614, 'n_tokens_neox': 572, 'n_words': 115}