Sonar is a quality control tool. It gauges quality of Java applications through the observance of coding rules conventions, metric measures and advanced indicators.
Sonar is based on the following projects :
JavaNCSS: Quality Metrics
Checkstyle: Style Cheking
PMD: Code scanning for potential errors.
Cobertura: Test Coverage
You could also use Simian for duplication detection.