Open ptupakul opened 4 years ago
Hi, The plugin doesn't set the line number. It evaluates XPath expressions and uses Jdom 2 for that. I haven't found yet a solution to evaluate the expression and get the line number.
The xml plugin from sonar has some nice helpers to find the line numbers (XmlTextRange). With the original xpath boolean the location is not possible to find. I added the XmlFile from
and now it looks like this.
hello
Does Mule sonar plugin codebase has this change of showing line numbers in file where bug is ?
I took latest sonar plugin codebase , built up sonar and ran code analysis.
I am not seeing line number of file.
please help
thanks abhay
Hi @abhayagarwalonline , just a few rules are prepared to show line numbers: "HTTP Listener should use HTTPS protocol" and "HTTP Listener should use a specific port property".
All others currently does not have an locationHint xpath and so still are showing on top of file.
thanks for the reply ... please let me know how to add locationHint xpath for other Rules
Just edit the rules-4.xml (and create a pull-request) ;-)
Each body of the
Example: value=
count(//mule:mule/http:listener-config)=0
or
//mule:mule/http:listener-config/http:listener-connection/@port='${https.port}'
or
//mule:mule/http:listener-config/http:listener-connection/@port='${https.private.port}'
locationHint="//*[local-name()='listener-config']"
Maybe just the "count(" parameter is working as well, but I did not check it:
locationHint="//mule:mule/http:listener-config"
(as currently two different xml implementations are used #23 ) the root note for locationHint probably needs to be whithout namespace:)
locationHint="//mule/http:listener-config"
Thanks for the reply, I will check and revert if it works for me
The locationHint without the name space locationHint="//mule/http:listener-config" doesn't seems to be working. I have used locationHint="//http:request" which will return the all http:request nodes. But it isn't working
Did you try
locationHint="//*[local-name()='listener-config']"
?
HI,
I am Uisng the SonarQube to check my Mule Code Quality, But for Java,C++... other languages it is displaying the Line number at right side corner but it is not for MuleCode see below fig.
I think should be more useful for quick understanding and fixing the issue if it has that feature.
Thanks,