var fileExtensions = new[] { ".cs", ".ts", ".html",".css" }; var files = Directory .GetFiles(rootPath, "*.*", SearchOption.AllDirectories) .ToList() .Where(f => !f.Contains(@"\bin\") && !f.Contains(@"\obj\") && !f.Contains(".min.") && fileExtensions.Any(fe => f.EndsWith(fe)) ); var totalLineQty = 0; var fileNum = 0; var fileCounts = new Dictionary<string, int>(); foreach (var ext in fileExtensions) fileCounts.Add(ext, 0); var calc = new EtcCalculator(files.Count()); var etc = DateTime.Now; foreach (var file in files) { fileNum++; Console.WriteLine($"Processing file {fileNum} of {files.Count()} - ETC = {etc:MM/dd/yyyy h:mm tt}"); var ext = Path.GetExtension(file).ToLower(); fileCounts[ext] += 1; totalLineQty += File.ReadAllLines(file).Count(); etc = calc.GetEtc(fileNum); } foreach (var key in fileCounts.Keys) { Debug.Print($"Total '{key}' file(s): {fileCounts[key]}"); } Debug.Print($"Total Files: {files.Count()}"); Debug.Print($"Lines of Code: {totalLineQty:#,##0}");