title: Similar code detector
body: <p>I'm search for a tool that could compare source codes for similarity.</p>
  
  <p>We have a very trivial system right now that has huge amount of false positives and the real positives can easily get buried in them.</p>
  
  <p>My requirements are:</p>
  
  <ul>
  <li>reasonably small amount of false positives</li>
  <li>good detection rate (yeah these are going against each other)</li>
  <li>ideally with a more complex output than just a single value</li>
  <li>usable for C (C99) and C++ (C++03 and optimally C++11)</li>
  <li>still maintained</li>
  <li>usable for comparing two source files against each other</li>
  <li>usable in non-interactive mode</li>
  </ul>
  
  <p>EDIT:</p>
  
  <p>To avoid confusion, the following two code snippets are identical and should be detected as such:</p>
  
  <p><code>for (int i = 0; i &lt; 10; i++) { bla; }</code></p>
  
  <p><code>int i; while (i &lt; 10) { bla; i++; }</code></p>
  
  <p>The same here:</p>
  
  <p><code>int x = 10; y = x + 5;</code></p>
  
  <p><code>int a = 10; y = a + 5;</code></p>