Hi There,
I have recently implemented the sonarqube integration for Mule 4 applications following the below tutorial.
Publish Mule 4 Code Review and Coverage to SonarQube
I am now trying to write a custom rule, which will do the following things;
- Scan the pom.xml and verify the project name ends with “-api”, “-sapi”, “-eapi”, “-papi”. Below is the rule I added to the rules4.xml
<rule id="3"
name="Mule Project Name Must End with -api/sapi/eapi/papi"
description="The Mule project name should end with one of the following suffixes: -api, -sapi, -eapi, -papi."
severity="MAJOR" applies="project" type="code_smell">
not(matches(/project/name, '^(.*)-(api|sapi|papi|eapi)$'))
</rule>
But the scanner is not checking for it correctly. It shows the pom.xml file considered in the code sectoin of sonarqube after running the analysis.
- Also I am trying to write one more rule about the scheduler which is also not working fine.
<rule id="22"
name="Scheduler frequency time unit must be set to MILLISECONDS"
description="Ensure Scheduler frequency time unit is MILLISECONDS or uses the default."
severity="MAJOR" type="code_smell">
count(//mule:mule/mule:flow/scheduler) > 0
or
//mule:mule/mule:flow/scheduler/scheduler:frequency/@timeUnit !='MILLISECONDS'
</rule>
Even when the timeUnits is in Hours or minutes it is NOT tagging the code smell.
Any thoughts how anybody can support here please?
Regards
Kaushik V