public int getInheritedAndNotOverridedAttributes(ClassObject classObj, bool IsAll = false) { int inheritedAndNotOverridedAttributes = 0; if (classObj.Ancestors != null) { foreach (string ascentor in classObj.Ancestors) { foreach (ClassObject classObjForAsc in classObjects) { if (classObjForAsc.Name == ascentor) { inheritedAndNotOverridedAttributes += getInheritedAndNotOverridedAttributes(classObjForAsc, true); break; } } } } if (IsAll) { inheritedAndNotOverridedAttributes += classObj.PrivateAttribCount; inheritedAndNotOverridedAttributes += classObj.PublicAttribCount; } return(inheritedAndNotOverridedAttributes); }
public int getInheritedAndNotOverridedMethods(ClassObject classObj, bool IsAll = false) { int inheritedAndNotOverridedMethods = 0; if (classObj.Ancestors != null) { foreach (string ascentor in classObj.Ancestors) { foreach (ClassObject classObjForAsc in classObjects) { if (classObjForAsc.Name == ascentor) { inheritedAndNotOverridedMethods += getInheritedAndNotOverridedMethods(classObjForAsc, true); break; } } } } if (IsAll) { foreach (MethodObject methodObj in classObj.Methodos) { if (!methodObj.IsOverrided) { inheritedAndNotOverridedMethods++; } } } return(inheritedAndNotOverridedMethods); }
public int getDIT(ClassObject classObj, int level = 0) { if (classObj.Ancestors != null) { List <int> dits = new List <int>(); dits.Add(0); foreach (string ascentor in classObj.Ancestors) { foreach (ClassObject classObjForAsc in classObjects) { if (classObjForAsc.Name == ascentor) { dits.Add(getDIT(classObjForAsc, level + 1)); break; } } } return(dits.Max()); } else { return(level); } }