<commit_before>(typeof exports !== "undefined" ? exports : window).travisCov = (function(){
    var main = {
      check: function(cov,userOptions){
        var options = {
          threshold: 50, //defaults to 50%
          global: true,
          local: false
        };

        if (userOptions){
          options.threshold = userOptions.threshold || options.threshold;
          options.threshold = userOptions.global || options.global;
          options.threshold = userOptions.local || options.local;
        }

        var totals =[];
        for (var filename in cov) {
          var data = cov[filename];
          this.reportFile( data);
        }
        var totalHits = 0;
        var totalSloc = 0;
        totals.forEach(function(elem){
          totalHits += elem[0];
          totalSloc += elem[1];
        });
        var globCoverage = totalHits / totalSloc * 100;
        if (options.global && globCoverage < options.threshold){
          console.log("Code coverage below threshold: "+globCoverage+ " < "+options.threshold);
          process.exit(1);
        }
      },
      reportFile: function( data) {
        var ret = {
          coverage: 0,
          hits: 0,
          misses: 0,
          sloc: 0
        };
        data.source.forEach(function(line, num){<commit_msg>Fix for options to report file<commit_after>(typeof exports !== "undefined" ? exports : window).travisCov = (function(){
    var main = {
      check: function(cov,userOptions){
        var options = {
          threshold: 50, //defaults to 50%
          global: true,
          local: false
        };

        if (userOptions){
          options.threshold = userOptions.threshold || options.threshold;
          options.threshold = userOptions.global || options.global;
          options.threshold = userOptions.local || options.local;
        }

        var totals =[];
        for (var filename in cov) {
          var data = cov[filename];
          this.reportFile( data,options);
        }
        var totalHits = 0;
        var totalSloc = 0;
        totals.forEach(function(elem){
          totalHits += elem[0];
          totalSloc += elem[1];
        });
        var globCoverage = totalHits / totalSloc * 100;
        if (options.global && globCoverage < options.threshold){
          console.log("Code coverage below threshold: "+globCoverage+ " < "+options.threshold);
          process.exit(1);
        }
      },
      reportFile: function( data,options) {
        var ret = {
          coverage: 0,
          hits: 0,
          misses: 0,
          sloc: 0
        };
        data.source.forEach(function(line, num){
{'fraction_non_alphanumeric': 0.11849601215343715, 'fraction_numerical': 0.012153437143942271, 'mean_word_length': 1.814102564102564, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '3982623', 'n_tokens_mistral': 742, 'n_tokens_neox': 713, 'n_words': 176}