<commit_before>var dirExists = require('../libs/directories').dirExists;
var walk = require('../libs/directories').walk;
var lib = require('../libs');
require('colors');

var rootDir = process.argv[2];

if (dirExists(rootDir)) {
  var astData = walk(rootDir);
  var data = lib(astData);

  printName();
  console.log('');

  var modules = Object.keys(data);

  modules
  .forEach(function (key) {
    // print header
    console.log(key.toUpperCase().green);
    console.log('----------------------------'.green);
    
    var counts = countsToArray(data[key]);
    printCounts(counts);

    console.log('');
  });

  console.log('');<commit_msg>refactor<commit_after>var dirExists = require('../libs/directories').dirExists;
var walk = require('../libs/directories').walk;
var lib = require('../libs');
require('colors');

var rootDir = process.argv[2];

if (dirExists(rootDir)) {
  var astData = walk(rootDir);
  var data = lib(astData);

  printName();
  console.log('');

  var modules = Object.keys(data);

  modules
  .forEach(function (key) {
    // print header
    console.log(key.toUpperCase().green);
    console.log('----------------------------'.green);
    
    printCounts(countsToArray(data[key]));

    console.log('');
  });

  console.log('');
{'fraction_non_alphanumeric': 0.22820919175911253, 'fraction_numerical': 0.001584786053882726, 'mean_word_length': 3.087378640776699, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2070628', 'n_tokens_mistral': 413, 'n_tokens_neox': 396, 'n_words': 74}