コード例 #1
0
ファイル: Program.cs プロジェクト: jangocheng/NsDepCop
        AnalyseCsProj(IDependencyAnalyzer dependencyAnalyzer, CsProjParser csProjParser)
        {
            var startTime = DateTime.Now;

            var analyzerMessages = dependencyAnalyzer
                                   .AnalyzeProject(csProjParser.SourceFilePaths, csProjParser.ReferencedAssemblyPaths)
                                   .ToArray();

            var endTime         = DateTime.Now;
            var elapsedTimeSpan = endTime - startTime;

            return(elapsedTimeSpan, analyzerMessages);
        }
コード例 #2
0
        public IEnumerable <TypeDependency> AnalyzeProject(IEnumerable <string> sourceFilePaths, IEnumerable <string> referencedAssemblyPaths)
        {
            _configRefreshLock.EnterReadLock();

            try
            {
                EnsureValidStateForAnalysis();
                return(_dependencyAnalyzer.AnalyzeProject(sourceFilePaths, referencedAssemblyPaths));
            }
            finally
            {
                _configRefreshLock.ExitReadLock();
            }
        }
コード例 #3
0
        private static TimeSpan AnalyseCsProj(IDependencyAnalyzer dependencyAnalyzer, CsProjParser csProjParser)
        {
            var startTime = DateTime.Now;

            var illegalDependencies = dependencyAnalyzer.AnalyzeProject(csProjParser.SourceFilePaths, csProjParser.ReferencedAssemblyPaths).ToList();

            var endTime         = DateTime.Now;
            var elapsedTimeSpan = endTime - startTime;

            Console.WriteLine($"Analysis took: {elapsedTimeSpan:mm\\:ss\\.fff}");

            DumpIllegalDependencies(illegalDependencies);

            return(elapsedTimeSpan);
        }