View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="JavaNCSS">
5         <property name="methodMaximum" value="4"/>
6       </module>
7     </module>
8   </module>
9   */
10  // xdoc section -- start
11  package com.puppycrawl.tools.checkstyle.checks.metrics.javancss;
12  
13  class Example2 {
14    // violation below, 'NCSS for this method is 6 (max allowed is 4)'
15    public void testMethod1() {
16      System.out.println("m-1:Line 1");
17      System.out.println("m-1:Line 2");
18      System.out.println("m-1:Line 3");
19      System.out.println("m-1:Line 4");
20      System.out.println("m-1:Line 5");
21    }
22  
23    public void testMethod2() {
24      System.out.println("m-2:Line 1");
25      System.out.println("m-2:Line 2");
26      System.out.println("m-2:Line 3");
27    }
28  }
29  // xdoc section -- end