<commit_before>var through = require('through2');

var indent = function (biggest, current) {
    for ( var i = 0; i < biggest - current.length; i++ ) {
        process.stdout.write(' ');
    }
};

module.exports = through.obj(function (file, type, done) {
    var results = JSON.parse(file.contents.toString()).sort(function (a, b) {
        return b.hz - a.hz;
    });

    var longest = results.slice().sort(function (a, b) {
        return b.name.length - a.name.length;
    })[0].name.length;

    var slowest = results.map(function (i) {
        return Math.round((1 / i.hz) * 1000).toString().length;
    }).sort().reverse()[0];

    var postcss = results.find(function (i) {
        return i.name == 'PostCSS';
    }).hz;

    process.stdout.write('\n');
    results.forEach(function (i) {
        process.stdout.write(i.name + ': ');
        indent(longest, i.name);

        var time = Math.round((1 / i.hz) * 1000).toString();
        process.stdout.write(time + ' ms ');
        indent(slowest, time);

        if ( i.name != 'PostCSS' ) {
            var times;
            if ( i.hz > postcss ) {
                times = (i.hz / postcss).toFixed(1);
                process.stdout.write('(' + times + ' times faster)');
            } else {
                times = (postcss / i.hz).toFixed(1);
                process.stdout.write('(' + times + ' times slower)');
            }
        }
        process.stdout.write('\n');
    });

    process.stdout.write('\n');
    done();
});
<commit_msg>Do not use ES6 methods in tasks<commit_after>var through = require('through2');

var indent = function (biggest, current) {
    for ( var i = 0; i < biggest - current.length; i++ ) {
        process.stdout.write(' ');
    }
};

module.exports = through.obj(function (file, type, done) {
    var results = JSON.parse(file.contents.toString()).sort(function (a, b) {
        return b.hz - a.hz;
    });

    var longest = results.slice().sort(function (a, b) {
        return b.name.length - a.name.length;
    })[0].name.length;

    var slowest = results.map(function (i) {
        return Math.round((1 / i.hz) * 1000).toString().length;
    }).sort().reverse()[0];

    var postcss;
    results.forEach(function (i) {
        if ( i.name == 'PostCSS' ) {
            postcss = i.hz;
            return false;
        }
    });

    process.stdout.write('\n');
    results.forEach(function (i) {
        process.stdout.write(i.name + ': ');
        indent(longest, i.name);

        var time = Math.round((1 / i.hz) * 1000).toString();
        process.stdout.write(time + ' ms ');
        indent(slowest, time);

        if ( i.name != 'PostCSS' ) {
            var times;
            if ( i.hz > postcss ) {
                times = (i.hz / postcss).toFixed(1);
                process.stdout.write('(' + times + ' times faster)');
            } else {
                times = (postcss / i.hz).toFixed(1);
                process.stdout.write('(' + times + ' times slower)');
            }
        }
        process.stdout.write('\n');
    });

    process.stdout.write('\n');
    done();
});

{'fraction_non_alphanumeric': 0.17870967741935484, 'fraction_numerical': 0.01064516129032258, 'mean_word_length': 1.900841908325538, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3169731', 'n_tokens_mistral': 1028, 'n_tokens_neox': 989, 'n_words': 203}