<commit_before>/*
 * servoyCodeCoverageInstrumentationFixer.js
 *
 * Parse all the JS Files instrumented by Istanbul in input directory tree and save parsed file in output directory tree.
 * Istanbul inject a variable on top of every js file and a method which initiates the variable.
 * Generate a UUID property for all injected variables and wrap the method injected by istanbul in a self executing variable.
 * Those variables are used by istanbul to count the line of code hitted during executions.
 * Move the variable and the injected method in a new scope file of the test solution.
 *
 * At the onOpen event the test solution should init the newly created scope file to initiate all the variables injected by istanbul
 * The global variable __coverage__ contains the stats of all the line of code hitted during executions.
 * At the onClose event the test solution should save the content of the variable __report__ in a .json file.
 */

// require node libraries
var fs = require('fs');
var readline = require('readline');
var stream = require('stream');
var path = require('path');
var util = require('util');
var uuid = require('node-uuid');
var Transform = stream.Transform || require('readable-stream').Transform;

var HELP = 'servoyCodeCoverageInstrumentationFixer arguments\n\
--h help\n\
--d <output_dir> <input_dir>\n\
mandatory argument! Parse file from directory tree <input_dir> and save parsed files in <output_dir> using the same tree structure\n\n\
--e <true|false>\n\
when set to true return error if any of the processed file is not instrumented. Default is false\n\n\
--rp <reportPath>\n\
The path to the reports directory. Use to store the collected coverage data to a json file\n\n\
--t <test_solution_path>\n\
The path to the directory of the test solution\n\n\
--i "<include_folder>[,<include_folder>]"\n\<commit_msg>Remove deprecated module by new one<commit_after>/*
 * servoyCodeCoverageInstrumentationFixer.js
 *
 * Parse all the JS Files instrumented by Istanbul in input directory tree and save parsed file in output directory tree.
 * Istanbul inject a variable on top of every js file and a method which initiates the variable.
 * Generate a UUID property for all injected variables and wrap the method injected by istanbul in a self executing variable.
 * Those variables are used by istanbul to count the line of code hitted during executions.
 * Move the variable and the injected method in a new scope file of the test solution.
 *
 * At the onOpen event the test solution should init the newly created scope file to initiate all the variables injected by istanbul
 * The global variable __coverage__ contains the stats of all the line of code hitted during executions.
 * At the onClose event the test solution should save the content of the variable __report__ in a .json file.
 */

// require node libraries
var fs = require('fs');
var readline = require('readline');
var stream = require('stream');
var path = require('path');
var util = require('util');
var uuid = require('uuid/v4');
var Transform = stream.Transform || require('readable-stream').Transform;

var HELP = 'servoyCodeCoverageInstrumentationFixer arguments\n\
--h help\n\
--d <output_dir> <input_dir>\n\
mandatory argument! Parse file from directory tree <input_dir> and save parsed files in <output_dir> using the same tree structure\n\n\
--e <true|false>\n\
when set to true return error if any of the processed file is not instrumented. Default is false\n\n\
--rp <reportPath>\n\
The path to the reports directory. Use to store the collected coverage data to a json file\n\n\
--t <test_solution_path>\n\
The path to the directory of the test solution\n\n\
--i "<include_folder>[,<include_folder>]"\n\
{'fraction_non_alphanumeric': 0.07754442649434572, 'fraction_numerical': 0.00026925148088314486, 'mean_word_length': 4.3530259365994235, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '6887325', 'n_tokens_mistral': 1010, 'n_tokens_neox': 975, 'n_words': 508}