Add custom Apex rules

The default rules provided by sonar is not sufficient for our enterprise salesforce apex needs. How can we customize and add more rules? Pl help with the complete process.

While browsing I found two possible options.

  1. Using Java, code custom code Apex rules
  2. Using Xpath … it used a custom apex template and use it.