<commit_before>/*******************************************************************************
 * @license
 * Copyright (c) 2012 VMware, Inc. All Rights Reserved.
 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
 * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
 * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
 * You can obtain a current copy of the Eclipse Public License from
 * http://www.opensource.org/licenses/eclipse-1.0.php
 *
 * Contributors:
 *     <NAME> - initial API and implementation
 ******************************************************************************/

/*global exports require console watchDirectory setTimeout */
var fs = require('fs');
var utils = require('../../jsdepend/utils.js');
var mapk = utils.mapk;
var filter = utils.filter;
var os = require('os');
var ignore = require('../filesystem').ignore;

//TODO: optimize tree for better memory usage:
//   - don't store full path in every tree node
//   - other optimzations?

//TODO: allow setting configuration options via .scripted file.

var FAKE = true; //Set to true to supress creating any real file system watchers.
                 // Dirwatch will function 'correctly' assuming no file system changes
                 // are being made. (i.e. it will read initial files but won't become
                 // aware of any changes).
//TODO: right now it is ok to use 'FAKE' always because the only code using dirwatch is test code
// and test code currently has never makes changes to the filesystem that need to
// be watched.

function makeWatcher(path, listener) {

	console.log('Creating a dirwatch instance'); // Grep for this is in scripted-log to see
												// if dirwatch is active.

	//BEGIN Configuration options

	var POLL_INTERVAL = 5000; //  if using polling, try to refresh directory data every X milliseconds
	var MAX_INIT_TIME = 4000; //  The maximum amount of time allowed for initially populating the tree. If this time
							  //  is exceeded we just keep whatever we got at the time.

	var MAX_WATCHERS = 2000;   //  MAX number of directory watchers to create per-tree.
						       //  If this number is exceeded remaining dirs will be read in, but not watched for changes.
	var MAX_READY_TIME = 2000; //  If initialization takes longer than this tree is returned while still continuing initialization
							   //  asynchronously.
						       
	//var POLL_INTERVAL = 10; //  try to refresh really often (stress test).
	<commit_msg>Cleanup: some logging calls<commit_after>/*******************************************************************************
 * @license
 * Copyright (c) 2012 VMware, Inc. All Rights Reserved.
 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
 * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
 * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
 * You can obtain a current copy of the Eclipse Public License from
 * http://www.opensource.org/licenses/eclipse-1.0.php
 *
 * Contributors:
 *     <NAME> - initial API and implementation
 ******************************************************************************/

/*global exports require console watchDirectory setTimeout */
var fs = require('fs');
var utils = require('../../jsdepend/utils.js');
var mapk = utils.mapk;
var filter = utils.filter;
var os = require('os');
var ignore = require('../filesystem').ignore;

//TODO: optimize tree for better memory usage:
//   - don't store full path in every tree node
//   - other optimzations?

//TODO: allow setting configuration options via .scripted file.

var FAKE = true; //Set to true to supress creating any real file system watchers.
                 // Dirwatch will function 'correctly' assuming no file system changes
                 // are being made. (i.e. it will read initial files but won't become
                 // aware of any changes).
//TODO: right now it is ok to use 'FAKE' always because the only code using dirwatch is test code
// and test code currently has never makes changes to the filesystem that need to
// be watched.

function makeWatcher(path, listener) {

//	console.log('Creating a dirwatch instance'); // Grep for this is in scripted-log to see
//												// if dirwatch is active.

	//BEGIN Configuration options

	var POLL_INTERVAL = 5000; //  if using polling, try to refresh directory data every X milliseconds
	var MAX_INIT_TIME = 4000; //  The maximum amount of time allowed for initially populating the tree. If this time
							  //  is exceeded we just keep whatever we got at the time.

	var MAX_WATCHERS = 2000;   //  MAX number of directory watchers to create per-tree.
						       //  If this number is exceeded remaining dirs will be read in, but not watched for changes.
	var MAX_READY_TIME = 2000; //  If initialization takes longer than this tree is returned while still continuing initialization
							   //  asynchronously.
						       
	//var POLL_INTERVAL = 10; //  try to refresh really often (stress test).
	
{'fraction_non_alphanumeric': 0.14020741922616672, 'fraction_numerical': 0.009573195053849222, 'mean_word_length': 3.186143572621035, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '957618', 'n_tokens_mistral': 1424, 'n_tokens_neox': 1254, 'n_words': 597}