Details
Description
I am working on getting static code analysis into SONAR using ANT for our Drupal project. Drupal uses ".module" suffixes for all the main PHP functionality. I added the following property to my build.xml file:
<property name="sonar.php.file.suffixes" value="inc,php,module" />
This allows the various analysis steps to parse module file as well.
The problem is with the source importer. It still uses the default prefix setting, because their is no configuration set during that step:
public String[] getFileSuffixes() {
String[] suffixes = StringUtils.split(PhpPlugin.FILE_SUFFIXES_DEFVALUE, ",");
//THERE IS NO configuration SET WHEN GETTING SUFFIXES FOR SOURCE IMPORTER
if (configuration != null) {
String[] configuredSuffixes = configuration.getStringArray(PhpPlugin.FILE_SUFFIXES_KEY);
if (configuredSuffixes != null && configuredSuffixes.length > 0)
}
return suffixes;
}
There are two routes to go here:
- Change the logic above
- Implement a configuration for the source importer
IT added.