title: Sonar CPD detecting blocks duplications
body: <p>I have done so much analysis on how sonar cpd detects duplicate blocks.But I am not able to trigger out exactly what the process it takes to detect blocks or lines of code.Do that have any minimum number of lines.</p>
  
  <p>For example if I am writing as below it is not detecting any code duplications even I repeat more that 20 times.</p>
  
  <pre><code>        System.out.println("this is good");
          System.out.println("this is good");
  
          System.out.println("this is good");
          System.out.println("this is good");
  
          System.out.println("this is good");
  
          System.out.println("this is good");
  
          System.out.println("this is good");
  
          System.out.println("this is good");
  
          System.out.println("this is good");
  
          System.out.println("this is good");
  </code></pre>
  
  <p>Later on I tried giving blocks duplications</p>
  
  <pre><code>     try
      {
      connection = null;
      }
      catch(Exception e){
          e.printStackTrace();
      }
      try
      {
      connection = null;
      }
      catch(Exception e){
          e.printStackTrace();
      }
      try{
      connection = null;
      }
      catch(Exception e){
          e.printStackTrace();
      }
      try{
      connection = null;
      }
      catch(Exception e){
          e.printStackTrace();
      }
  </code></pre>
  
  <p>Here it is considering as two block even though it has many blocks.</p>
  
  <p>Please let me know the exact process followed in this duplication detection by sonar 3.4.1</p>
  
  <p>In this 
  <a href="http://docs.sonarsource.org/3.1/apidocs/src-html/org/sonar/plugins/cpd/SonarEngine.html" rel="nofollow">http://docs.sonarsource.org/3.1/apidocs/src-html/org/sonar/plugins/cpd/SonarEngine.html</a></p>
  
  <p>I found a constant block size as 10. But I am able to relate this in my observation.</p>