{"size": 1276, "ext": "js", "max_stars_repo_path": "lib/commentsFinder.js", "max_stars_repo_name": "Ergosign/assemble-kss", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/commentsFinder.js", "max_issues_repo_name": "Ergosign/assemble-kss", "max_issues_repo_issues_event_min_datetime": "2018-04-17T11:44:25.000Z", "max_issues_repo_issues_event_max_datetime": "2018-04-17T11:44:25.000Z", "max_forks_repo_path": "lib/commentsFinder.js", "max_forks_repo_name": "Ergosign/assemble-kss", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 27.1489361702, "max_line_length": 100, "alphanum_fraction": 0.6567398119}
var commentBlockRegex = /\/\*(.|\n)*?\*\//gmi;

var commentsFinder = module.exports;

commentsFinder.findKssCommentsInFile = function (filePath, grunt) {

    var returnArray = [];

    var fileContents = grunt.file.read(filePath);

    fileContents = fileContents.replace(/\r\n/g, '\n').replace(/\r/g, '\n');

    var commentsFound = commentBlockRegex.exec(fileContents);

    while (commentsFound !== null) {
        returnArray.push({
            comment: commentsFound[0],
            srcPath: filePath
        });
        commentsFound = commentBlockRegex.exec(fileContents);
    }

    return returnArray;

};

commentsFinder.findCommentsInDirectory = function (directory, sourceMask, grunt) {

    var returnArray = [];

    grunt.file.recurse(directory, function (abspath, rootdir, subdir, filename) {
        if (grunt.file.isDir(abspath)) {
            var directoryArray = commentsFinder.findCommentsInDirectory(abspath, sourceMask, grunt);
            returnArray = returnArray.concat(directoryArray);
        } else if (grunt.file.isMatch(sourceMask, filename)) {
            var commentsInFile = commentsFinder.findKssCommentsInFile(abspath, grunt);
            returnArray = returnArray.concat(commentsInFile);
        }
    });

    return returnArray;
};




