Inheritance: ClassCouplingAnalyzerBase
Beispiel #1
0
        private IEnumerable <ITypeCoupling> CalculateClassCoupling(TypeDeclarationSyntax type, IEnumerable <IMemberMetric> memberMetrics)
        {
            var second = new TypeClassCouplingAnalyzer(Model).Calculate(type);

            return(memberMetrics.SelectMany(x => x.Dependencies)
                   .Concat(second)
                   .GroupBy(x => x.ToString())
                   .Select(x => new TypeCoupling(x.First().TypeName, x.First().Namespace, x.First().Assembly, x.SelectMany(y => y.UsedMethods), x.SelectMany(y => y.UsedProperties), x.SelectMany(y => y.UsedEvents)))
                   .OrderBy(x => x.TypeName)
                   .AsArray());
        }
		private IEnumerable<ITypeCoupling> CalculateClassCoupling(TypeDeclarationSyntax type, IEnumerable<IMemberMetric> memberMetrics)
		{
			var second = new TypeClassCouplingAnalyzer(Model).Calculate(type);
			return memberMetrics.SelectMany(x => x.ClassCouplings)
				.Concat(second)
				.GroupBy(x => x.ToString())
				.Select(x => new TypeCoupling(x.First().TypeName, x.First().Namespace, x.First().Assembly, x.SelectMany(y => y.UsedMethods), x.SelectMany(y => y.UsedProperties), x.SelectMany(y => y.UsedEvents)))
				.OrderBy(x => x.TypeName)
				.AsArray();
		}