View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="ClassDataAbstractionCoupling"/>
5     </module>
6   </module>
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.metrics.classdataabstractioncoupling;
10  
11  import com.puppycrawl.tools.checkstyle.checks.metrics.classdataabstractioncoupling.ignore.Example7;
12  import com.puppycrawl.tools.checkstyle.checks.metrics.classdataabstractioncoupling.ignore.deeper.Example4;
13  import com.puppycrawl.tools.checkstyle.checks.metrics.classdataabstractioncoupling.ignore.deeper.Example5;
14  import com.puppycrawl.tools.checkstyle.checks.metrics.classdataabstractioncoupling.ignore.deeper.Example6;
15  
16  import java.math.BigInteger;
17  import java.util.Map;
18  import java.util.HashMap;
19  import java.util.Set;
20  import java.util.HashSet;
21  import java.util.concurrent.atomic.AtomicInteger;
22  
23  // xdoc section -- start
24  // violation below, "Class Data Abstraction Coupling is 8 (max allowed is 7)."
25  public class Example2 {
26    Set set = new HashSet(); // Ignored by default
27    Map map = new HashMap(); // Ignored by default
28  
29    AtomicInteger atomicInteger = new AtomicInteger(); // Counted 1
30    BigInteger bigInteger = new BigInteger("0");
31    Example1 example1 = new Example1();
32    Example3 example3 = new Example3();
33    Example4 example4 = new Example4();
34    Example5 example5 = new Example5();
35    Example6 example6 = new Example6();
36    Example7 example7 = new Example7(); // Counted 8
37  }
38  // xdoc section -- end