public MessageCollection CheckType (TypeDefinition type, Runner runner) 
		{
			messageCollection = new MessageCollection ();
			codeDuplicatedLocator = new CodeDuplicatedLocator ();
			
			ICollection siblingClasses = Utilities.GetInheritedClassesFrom (type);
			if (siblingClasses.Count >= 2) 
				CompareSiblingClasses (siblingClasses);

			if (messageCollection.Count == 0)
				return null;
			return messageCollection;
		}
		public MessageCollection CheckType (TypeDefinition typeDefinition, Runner runner) 
		{
			messageCollection = new MessageCollection ();
			CodeDuplicatedLocator codeDuplicatedLocator = new CodeDuplicatedLocator ();
			foreach (MethodDefinition currentMethod in typeDefinition.Methods) {
				foreach (Message message in codeDuplicatedLocator.CompareMethodAgainstTypeMethods (currentMethod, typeDefinition)) {
					messageCollection.Add (message);
				}
				codeDuplicatedLocator.CheckedMethods.Add (currentMethod.Name);
			}
			
			if (messageCollection.Count == 0)
				return null;
			return messageCollection;
		}
        public MessageCollection CheckType(TypeDefinition type, Runner runner)
        {
            messageCollection     = new MessageCollection();
            codeDuplicatedLocator = new CodeDuplicatedLocator();

            ICollection siblingClasses = Utilities.GetInheritedClassesFrom(type);

            if (siblingClasses.Count >= 2)
            {
                CompareSiblingClasses(siblingClasses);
            }

            if (messageCollection.Count == 0)
            {
                return(null);
            }
            return(messageCollection);
        }
예제 #4
0
        public MessageCollection CheckType(TypeDefinition typeDefinition, Runner runner)
        {
            messageCollection = new MessageCollection();
            CodeDuplicatedLocator codeDuplicatedLocator = new CodeDuplicatedLocator();

            foreach (MethodDefinition currentMethod in typeDefinition.Methods)
            {
                foreach (Message message in codeDuplicatedLocator.CompareMethodAgainstTypeMethods(currentMethod, typeDefinition))
                {
                    messageCollection.Add(message);
                }
                codeDuplicatedLocator.CheckedMethods.Add(currentMethod.Name);
            }

            if (messageCollection.Count == 0)
            {
                return(null);
            }
            return(messageCollection);
        }
 public AvoidCodeDuplicatedInSiblingClassesRule()
 {
     codeDuplicatedLocator = new CodeDuplicatedLocator (this);
     siblingClasses = new List<TypeDefinition> ();
 }
 public AvoidCodeDuplicatedInSameClassRule()
 {
     locator = new CodeDuplicatedLocator (this);
 }
예제 #7
0
 public AvoidCodeDuplicatedInSameClassRule()
 {
     locator = new CodeDuplicatedLocator(this);
 }
예제 #8
0
 public AvoidCodeDuplicatedInSiblingClassesRule()
 {
     codeDuplicatedLocator = new CodeDuplicatedLocator(this);
     siblingClasses        = new List <TypeDefinition> ();
 }
		public AvoidCodeDuplicatedInSiblingClassesRule ()
		{
			codeDuplicatedLocator = new CodeDuplicatedLocator (this);
		}