Exemplo n.º 1
0
 private void AddEfferentCoupling(MethodReference from, IEnumerable<MemberAccess> to, int complexity)
 {
     CouplingCacheNode node;
     var fromFullName = from.GetCacheName();
     if (!_efferentCache.TryGetValue(fromFullName, out node))
     {
         lock (_efferentCache)
         {
             if (!_efferentCache.TryGetValue(fromFullName, out node))
             {
                 node = new CouplingCacheNode(fromFullName, from);
                 node.Complexity = complexity;
                 _efferentCache.Add(fromFullName, node);
             }
         }
     }
     lock (node)
     {
         foreach (var current in to)
         {
             node.AddCoupling(new Coupling(current.MemberReference.GetCacheName(), current.IsReadOnly, false,
                                           current.IsSelfCall, current.OnField, current.ActualMethodDefinition));
         }
     }
 }