<commit_before>const getBulletUrl = (color, version) => `images/bullet_${color}.png?v=${version}`;

const getIconUrl = (lag, version) => {
    const color =
        lag < 100 && 'green' ||
        lag < 300 && 'yellow' ||
        lag < 1000 && 'orange' ||
        lag < 5000 && 'red' ||
        'black';
    return getBulletUrl(color, version);
};

const getIconLinkElement = () => {
    let icon = document.querySelector('link[rel~=icon]');
    if (!icon) {
        icon = document.createElement('link');
        icon.rel = 'icon';
        document.head.appendChild(icon);
    }
    icon.type = 'image/png';
    return icon;
};

module.exports = (user, pings, version) => {
    const iconElement = getIconLinkElement();
    user.on('read', () => iconElement.href = getIconUrl(pings.currentLag(), version));
};<commit_msg>Change favicon color thresholds<commit_after>const getBulletUrl = (color, version) => `images/bullet_${color}.png?v=${version}`;

const getIconUrl = (lag, version) => {
    const color =
        lag < 50 && 'green' ||
        lag < 100 && 'yellow' ||
        lag < 500 && 'orange' ||
        lag < 1000 && 'red' ||
        'black';
    return getBulletUrl(color, version);
};

const getIconLinkElement = () => {
    let icon = document.querySelector('link[rel~=icon]');
    if (!icon) {
        icon = document.createElement('link');
        icon.rel = 'icon';
        document.head.appendChild(icon);
    }
    icon.type = 'image/png';
    return icon;
};

module.exports = (user, pings, version) => {
    const iconElement = getIconLinkElement();
    user.on('read', () => iconElement.href = getIconUrl(pings.currentLag(), version));
};
{'fraction_non_alphanumeric': 0.17951807228915662, 'fraction_numerical': 0.01566265060240964, 'mean_word_length': 2.973684210526316, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '5491237', 'n_tokens_mistral': 547, 'n_tokens_neox': 514, 'n_words': 111}