Example #1
0
 public void AddSourceCodeMetric(SourceCodeMetric metric)
 {
     _sourceCodeMetrics.Add(metric);
     Interlocked.Increment(ref _totalNumberOfFiles);
     Interlocked.Add(ref _totalSizeOfFiles, metric.FileSize);
     Interlocked.Add(ref _totalLinesOfCode, metric.LinesOfCode);
 }
        public SourceCodeMetric GetSourceCodeMetric(string filePath)
        {
            SourceCodeMetric result = new SourceCodeMetric()
            {
                FilePath = filePath,
                LinesOfCode = GetLinesOfCode(filePath),
                FileSize = new FileInfo(filePath).Length
            };

            return result;
        }