ArchiMetrics.Analysis.Metrics.TypeMetricsCalculator.GetEfferentCoupling C# (CSharp) Method

GetEfferentCoupling() private method

private GetEfferentCoupling ( Microsoft.CodeAnalysis.SyntaxNode classDeclaration, ISymbol sourceSymbol ) : int
classDeclaration Microsoft.CodeAnalysis.SyntaxNode
sourceSymbol ISymbol
return int
		private int GetEfferentCoupling(SyntaxNode classDeclaration, ISymbol sourceSymbol)
		{
			var typeSyntaxes = classDeclaration.DescendantNodesAndSelf().OfType<TypeSyntax>();
			var commonSymbolInfos = typeSyntaxes.Select(x => Model.GetSymbolInfo(x)).AsArray();
			var members = commonSymbolInfos
				.Select(x => x.Symbol)
				.Where(x => x != null)
				.Select(x =>
					{
						var typeSymbol = x as ITypeSymbol;
						return typeSymbol == null ? x.ContainingType : x;
					})
				.Cast<ITypeSymbol>()
				.WhereNotNull()
				.DistinctBy(x => x.ToDisplayString())
				.Count(x => !x.Equals(sourceSymbol));

			return members;
		}