示例#1
0
		private static int smethod_4(BfMethod bfMethod_0)
		{
			return bfMethod_0.Cyclomatic;
		}
示例#2
0
		private static int smethod_2(BfMethod bfMethod_0)
		{
			return bfMethod_0.LogicalLineCount;
		}
示例#3
0
		private static int smethod_3(BfMethod bfMethod_0)
		{
			return bfMethod_0.CommentLineCount;
		}
示例#4
0
		internal void method_4()
		{
			if (this.bool_0)
			{
				Logger.LogWarning("Type.Populate1", "populate got called more than once");
			}
			else
			{
				this.bool_0 = true;
				if (this.IsInCoreAssembly)
				{
					this.bfType_0 = this.bfCache_0.method_7(this.typeDefinition_0.BaseType);
					if (this.bfType_0 != null && this.bfType_0.FullName != "System.Object")
					{
						this.bfType_0.DerivedTypes.method_1(this);
					}
					foreach (TypeReference typeReference_ in this.typeDefinition_0.Interfaces)
					{
						BfType bfType = this.bfCache_0.method_7(typeReference_);
						this.typeCollection_0.method_1(bfType);
						bfType.DerivedTypes.method_1(this);
					}
					foreach (FieldDefinition fieldDef in this.typeDefinition_0.Fields)
					{
						BfField item = new BfField(this.bfCache_0, fieldDef, this);
						this.fieldCollection_0.method_1(item);
					}
					foreach (MethodDefinition methodDef in this.typeDefinition_0.Methods)
					{
						BfMethod bfMethod = new BfMethod(this.bfCache_0, methodDef, this);
						this.methodCollection_0.method_1(bfMethod);
						this.bfAssembly_0.method_5().Add(bfMethod.UniqueName, bfMethod);
					}
					foreach (MethodDefinition methodDef in this.typeDefinition_0.Constructors)
					{
						BfMethod bfMethod = new BfMethod(this.bfCache_0, methodDef, this);
						this.methodCollection_0.method_1(bfMethod);
						this.bfAssembly_0.method_5().Add(bfMethod.UniqueName, bfMethod);
					}
					foreach (EventDefinition eventDef in this.typeDefinition_0.Events)
					{
						BfEvent item2 = new BfEvent(this.bfCache_0, eventDef, this);
						this.eventCollection_0.method_1(item2);
					}
					this.int_1 = this.typeDefinition_0.GenericParameters.Count;
					this.method_6();
					this.typeCollection_0.ClearHash();
					this.fieldCollection_0.ClearHash();
					this.methodCollection_0.ClearHash();
					this.eventCollection_0.ClearHash();
				}
			}
		}
示例#5
0
		private static int smethod_1(BfMethod bfMethod_0)
		{
			return bfMethod_0.PhysicalLineCount;
		}
		private static double smethod_0(BfMethod bfMethod_0)
		{
			return (double)((BfMethod)bfMethod_0).ILCount;
		}
示例#7
0
		private BfMethod method_5(BfMethod bfMethod_0, MethodReference methodReference_0)
		{
			GenericInstanceType genericInstanceType = (GenericInstanceType)methodReference_0.DeclaringType;
			BfType bfType = this._cache.method_7(genericInstanceType.ElementType);
			HashSet<string> hashSet = new HashSet<string>();
			BfMethod result;
			if (bfType == null)
			{
				result = null;
			}
			else
			{
				foreach (GenericParameter genericParameter in bfType.method_2().GenericParameters)
				{
					hashSet.Add(genericParameter.FullName);
				}
				MethodReference methodReference = null;
				List<MethodReference> list = new List<MethodReference>();
				list.AddRange(bfType.method_2().Constructors.Cast<MethodReference>());
				list.AddRange(bfType.method_2().Methods.Cast<MethodReference>());
				using (List<MethodReference>.Enumerator enumerator2 = list.GetEnumerator())
				{
					while (enumerator2.MoveNext())
					{
						MethodDefinition methodDefinition = (MethodDefinition)enumerator2.Current;
						if (methodDefinition.Name == methodReference_0.Name && methodDefinition.Parameters.Count == methodReference_0.Parameters.Count)
						{
							bool flag = true;
							for (int i = 0; i < methodDefinition.Parameters.Count; i++)
							{
								ParameterDefinition parameterDefinition = methodDefinition.Parameters[i];
								ParameterDefinition parameterDefinition2 = methodReference_0.Parameters[i];
								if (hashSet.Contains(BfCache.smethod_3(parameterDefinition.ParameterType).FullName))
								{
									if (!parameterDefinition2.ToString().StartsWith("A_"))
									{
										flag = false;
									}
								}
								else if (!(Regex.Replace(parameterDefinition2.ParameterType.FullName, "<[^>]*>", "") == Regex.Replace(parameterDefinition.ParameterType.FullName, "<[^>]*>", "")))
								{
									flag = false;
								}
							}
							if (flag)
							{
								methodReference = methodDefinition;
							}
						}
					}
				}
				if (methodReference == null)
				{
					Logger.LogWarning("GetMethodRefFromGenericInstance", "Not good " + methodReference_0.ToString());
					result = null;
				}
				else
				{
					BfMethod.smethod_0(methodReference);
					result = this._cache.method_5(methodReference);
				}
			}
			return result;
		}
		private static double smethod_7(BfMethod bfMethod_0)
		{
			return (double)((BfMethod)bfMethod_0).ParameterCount;
		}
		private static double smethod_8(BfMethod bfMethod_0)
		{
			return (double)((BfMethod)bfMethod_0).OverloadCount;
		}
		private static double smethod_4(BfMethod bfMethod_0)
		{
			return (double)((BfMethod)bfMethod_0).LogicalLineCount;
		}
		private static double smethod_6(BfMethod bfMethod_0)
		{
			return (double)((BfMethod)bfMethod_0).Calls.Count;
		}
		private static double smethod_3(BfMethod bfMethod_0)
		{
			return ((BfMethod)bfMethod_0).PercentComment;
		}
		private static double smethod_2(BfMethod bfMethod_0)
		{
			return (double)((BfMethod)bfMethod_0).Cyclomatic;
		}
		private static double smethod_1(BfMethod bfMethod_0)
		{
			return (double)((BfMethod)bfMethod_0).PhysicalLineCount;
		}
示例#15
0
		private static int smethod_5(BfMethod bfMethod_0)
		{
			return bfMethod_0.ILCount;
		}
		private static double smethod_9(BfMethod bfMethod_0)
		{
			return (double)((BfMethod)bfMethod_0).TypesUsed.Count;
		}
示例#17
0
		internal BfMethod method_5(MethodReference methodReference_0)
		{
			BfAssembly bfAssembly;
			BfMethod result;
			if (methodReference_0.DeclaringType.Scope is AssemblyNameReference)
			{
				bfAssembly = this.dictionary_0[((AssemblyNameReference)methodReference_0.DeclaringType.Scope).FullName];
			}
			else
			{
				if (!(methodReference_0.DeclaringType.Scope is ModuleDefinition))
				{
					Logger.LogWarning("GetBfMethod1", "Couldn't find assembly for method: " + methodReference_0.ToString());
					result = null;
					return result;
				}
				bfAssembly = this.dictionary_0[((ModuleDefinition)methodReference_0.DeclaringType.Scope).Assembly.Name.FullName];
			}
			string text = BfMethod.smethod_0(methodReference_0);
			BfMethod bfMethod;
			bfAssembly.method_5().TryGetValue(text, out bfMethod);
			if (bfMethod == null)
			{
				BfType bfType = this.method_7(methodReference_0.DeclaringType);
				List<MethodDefinition> list = new List<MethodDefinition>();
				list.AddRange(bfType.method_2().Constructors.Cast<MethodDefinition>());
				list.AddRange(bfType.method_2().Methods.Cast<MethodDefinition>());
				foreach (MethodDefinition current in list)
				{
					if (text == BfMethod.smethod_0(current))
					{
						bfMethod = new BfMethod(this, current, bfType);
						this.methodCollection_0.method_1(bfMethod);
						bfType.Methods.method_1(bfMethod);
						bfAssembly.method_5().Add(bfMethod.UniqueName, bfMethod);
						break;
					}
				}
				if (bfMethod == null)
				{
					Logger.LogWarning("GetBfMethod2", "Couldn't find: " + text);
				}
			}
			result = bfMethod;
			return result;
		}
		private static bool smethod_13(BfMethod bfMethod_0)
		{
			return !bfMethod_0.IsInCoreAssembly;
		}