<?xml version="1.0"?>
<!-- 
/*
 * Copyright 2001-2004 The Apache Software Foundation.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 -->


<ruleset name="coupling">
  <description>
	These are new rules for coupling
  </description>

    <rule name="CouplingBetweenObjectsRule"
        message="High amount of different objects as memebers donotes a high coupling"
        class="net.sourceforge.pmd.rules.CouplingBetweenObjectsRule">
    <description>
        Rule counts unique attributes, local variables and return types within an object. An amount
        higher than specified threshold can indicate a high degree of couping with in an object
    </description>
    <priority>3</priority>
    <properties>
      <property name="threshold" value="20"/>
    </properties>
    <example>
    <![CDATA[
      import com.Blah;
      import org.Bar;
      import org.Bardo;
      //
      public class Foo {
        private Blah var1;
        private Bar var2;
        //followed by many imports of unique objects

        void ObjectC doWork() {
           Bardo var55;
           ObjectA var44;
           ObjectZ var93;
           return something;
        }

        }
        ]]>
    </example>
  </rule>

  <rule name="ExcessiveImportsRule"
     message="A high number of imports can indicate a high degree of coupling within an object."
     class="net.sourceforge.pmd.rules.ExcessiveImportsRule">
     <description>
      A high number of imports can indicate a high degree of coupling within
      an object. Rule counts the number of unique imports and reports a violation
      if the count is above the user defined threshold.
  </description>
  <priority>3</priority>
  <properties>
      <property name="minimum" value="30"/>
  </properties>
  <example>
      <![CDATA[
      import blah.blah.Bardo;
      import blah.blah.Hardo;
      import blah.blah.Bar;
      import blah.net.ObjectA;
      //imports over some threshold
      public class Foo {
        public void doWork() {}
      }
      ]]>
  </example>

   </rule>

  </ruleset>


