<commit_before>(function (mod) {
    if (typeof exports == "object" && typeof module == "object") return mod(exports); // CommonJS (node et al.)
    if (typeof define == "function" && define.amd) return define(["exports"], mod); // AMD (requirejs et al)
}) (function (exports) {

    var getters = {};
    getters.zip = require('../getters/zip.js');

    var parsers = {};
    parsers.manifest = require('../parsers/manifest.js');

    function report(zipfile) {
        var textreport = "";
        var fileset = getters.zip.get({filename:zipfile});
        var propset = parsers.manifest.parse(fileset);

        var RuleSet = require('../rules/ruleset.js');
        var ruleset = new RuleSet.RuleSet();
        ruleset.add({filename:'../rules/rules.json'});

        var reportitems = ruleset.resolve(propset);

        if (reportitems.length>0) {
            for (var i=0 ; i<reportitems.length ; i++) {
                var item = reportitems[i];
                var file_name;
                try { file_name = item.file_ref.name } catch (e) { file_name = '' };
                textreport += zipfile + '/' + file_name + '\t'+';'+';'+'\t' + item.message + "\n";
                //TODO: also add offset,line number,snippet info
            }
        } else {
            textreport += zipfile + ": no errors detected\n";
        }
        return textreport;
    }

    exports.report = report;
});<commit_msg>reporter now generates OK message<commit_after>(function (mod) {
    if (typeof exports == "object" && typeof module == "object") return mod(exports); // CommonJS (node et al.)
    if (typeof define == "function" && define.amd) return define(["exports"], mod); // AMD (requirejs et al)
}) (function (exports) {

    var getters = {};
    getters.zip = require('../getters/zip.js');

    var parsers = {};
    parsers.manifest = require('../parsers/manifest.js');

    function report(zipfile) {
        var textreport = "";
        var fileset = getters.zip.get({filename:zipfile});
        var propset = parsers.manifest.parse(fileset);

        var RuleSet = require('../rules/ruleset.js');
        var ruleset = new RuleSet.RuleSet();
        ruleset.add({filename:'../rules/rules.json'});

        var reportitems = ruleset.resolve(propset);

        if (reportitems.length>0) {
            for (var i=0 ; i<reportitems.length ; i++) {
                var item = reportitems[i];
                var file_name;
                try { file_name = item.file_ref.name } catch (e) { file_name = '' };
                textreport += zipfile + '/' + file_name + '\t'+';'+';'+'\t' + item.message + "\n";
                //TODO: also add offset,line number,snippet info
            }
        } else {
            textreport += zipfile + "\tOK\n";
        }
        return textreport;
    }

    exports.report = report;
});
{'fraction_non_alphanumeric': 0.16336633663366337, 'fraction_numerical': 0.0014144271570014145, 'mean_word_length': 2.167973124300112, 'pattern_counts': {'":': 1, '<': 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': '5246282', 'n_tokens_mistral': 859, 'n_tokens_neox': 822, 'n_words': 198}