Example #1
0
        public AnalyzerMessageBase[] AnalyzeProject(IAnalyzerConfig config, string[] sourcePaths, string[] referencedAssemblyPaths)
        {
            var resultBuilder = new AnalyzeProjectResultBuilder();

            var typeDependencyEnumerator = GetTypeDependencyEnumerator(resultBuilder.AddTrace);
            var dependencyAnalyzer       = new DependencyAnalyzer(config, typeDependencyEnumerator, resultBuilder.AddTrace);
            var illegalDependencies      = dependencyAnalyzer.AnalyzeProject(sourcePaths, referencedAssemblyPaths);

            foreach (var illegalDependency in illegalDependencies)
            {
                resultBuilder.AddIllegalDependency(illegalDependency);
            }

            resultBuilder.AddCacheStatistics(dependencyAnalyzer.HitCount, dependencyAnalyzer.MissCount, dependencyAnalyzer.EfficiencyPercent);

            return(resultBuilder.ToArray());
        }