<commit_before>/**
 * [文件描述]
 *
 * @author helinjiang
 * @date 2015/11/19
 */
var walkSync = require('walk-sync');
var fs = require("fs");
var path = require("path");
var util = require("./lib/util");
var _ = require('underscore');

/**
 * 文件对象
 * TODO 考虑是否要加入mode权限
 * @param basePath
 * @param relativePath
 * @param size
 * @param mtime
 * @constructor
 */
function FileItem(basePath, relativePath, size, mtime) {
    this.basePath = basePath;
    this.relativePath = relativePath;
    this.size = size;
    this.mtime = mtime;

    this.fileName = path.basename(this.relativePath);
    this.fullPath = path.join(this.basePath, this.relativePath);
    this.md5 = '';
}

/**
 * 获得某路径下所有的文件。
 * @param {String} paths 路径
 * @return {Array} 结果，每个数组的元素为FileItem。
 */
function getAllFile(paths) {
    var entry = walkSync.entries(paths, {directories: false});

    var result = [];
    entry.forEach(function (item) {<commit_msg>丰富参数注释<commit_after>/**
 * [文件描述]
 *
 * @author helinjiang
 * @date 2015/11/19
 */
var walkSync = require('walk-sync');
var fs = require("fs");
var path = require("path");
var util = require("./lib/util");
var _ = require('underscore');

/**
 * 文件对象
 * TODO 考虑是否要加入mode权限
 * @param {String} basePath 基础路径
 * @param {String} relativePath 相对路径
 * @param {String} size 文件大小
 * @param {String} mtime 文件最后修改时间
 * @constructor
 */
function FileItem(basePath, relativePath, size, mtime) {
    this.basePath = basePath;
    this.relativePath = relativePath;
    this.size = size;
    this.mtime = mtime;

    this.fileName = path.basename(this.relativePath);
    this.fullPath = path.join(this.basePath, this.relativePath);
    this.md5 = '';
}

/**
 * 获得某路径下所有的文件。
 * @param {String} paths 路径
 * @return {Array} 结果，每个数组的元素为FileItem。
 */
function getAllFile(paths) {
    var entry = walkSync.entries(paths, {directories: false});

    var result = [];
    entry.forEach(function (item) {
{'fraction_non_alphanumeric': 0.15853018372703412, 'fraction_numerical': 0.009448818897637795, 'mean_word_length': 3.7531172069825436, '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': '7597799', 'n_tokens_mistral': 734, 'n_tokens_neox': 734, 'n_words': 148}