b3k
Elixir projects in SonarQube
Hi!
Has anyone integrated the elixir project in SonarQube?
I saw the https://github.com/arthepsy/sonar-elixir repo, but it did’t bring anything valuable to Sonar in case of Elixir.
Most Liked
adrienmo
I’ve tried to make it work with some duct tape!
Here is the plugin:
Which I just found out there and compiled, basically it just give you the ability to scan .ex and .exs files.
Then I extended elixir existing tools to create generic reports:
- generic code coverage: I made a pull request that was accepted by the library: https://github.com/parroty/excoveralls, you can generate the report with: “mix excoveralls.xml”
- generic issues: I made a plugin for credo https://github.com/adrienmo/credo_sonarqube
- generic test execution: I made an ExUnit formatter: https://github.com/adrienmo/ex_unit_sonarqube
You then need to configure your:
sonar.externalIssuesReportPathssonar.coverageReportPathssonar.testExecutionReportPaths
accordingly.
Coverage and execution works fine, credo plugin need some work to classify correctly bug/codesmell/vulnerability and time effort (right now it reports everything as code smell with 90 minutes time resolution) but it works 
Hope it helps!
gausby
What’s a sonar cube ?
waystilos
Same here. It’s not even considered if there is no sonarqube support.
csadewa
Thanks @adrienmo , i am able to integrate elixir to sonarqube recently with your help!
It need a little bit of adjustment though on recent version of sonarqube (community edition, version 9.5):
- need to adjust a bit output of
coveralls.xml:sed -i 's/file path="\//file path="/g' cover/excoveralls.xml - need to adjust a bit output of
credo_sonarqube:sed -i 's/startLine": null/startLine": 1/g' credo_sonarqube.json







