b3k

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.

#ci

Most Liked

adrienmo

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:

You then need to configure your:

  • sonar.externalIssuesReportPaths
  • sonar.coverageReportPaths
  • sonar.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 :slight_smile:

Hope it helps!

gausby

gausby

What’s a sonar cube ?

waystilos

waystilos

Same here. It’s not even considered if there is no sonarqube support.

csadewa

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):

  1. need to adjust a bit output of coveralls.xml: sed -i 's/file path="\//file path="/g' cover/excoveralls.xml
  2. need to adjust a bit output of credo_sonarqube: sed -i 's/startLine": null/startLine": 1/g' credo_sonarqube.json

Where Next?

Popular in Questions Top

_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
Werner
Hi, I’m using Ubuntu 18.04 and after updating to OTP-24.0 yesterday i have this warning when I run “mix local.hex”: 14:57:30.512 [warn] ...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement