Giter Site home page Giter Site logo

jonaswadsten / sonar-erlang Goto Github PK

View Code? Open in Web Editor NEW

This project forked from evolution-gaming/sonar-erlang

0.0 0.0 0.0 1.3 MB

SonarQube Server plugin for Erlang project analysis.

Java 37.97% HTML 3.10% Erlang 58.75% JavaScript 0.01% Makefile 0.09% Python 0.10%

sonar-erlang's Introduction

Build Quality Gate Status Maintainability Rating

About

SonarQube server Erlang language plugin.

Description / Features

The plugin enables analysis of Erlang within SonarQube.

Usage

Run an Analysis with the SonarQube Scanner (recommended method)

To run an analysis of your Erlang project, use the SonarQube Scanner. A sample project is available on GitHub: https://github.com/SonarSource/sonar-scanning-examples/tree/master/sonarqube-scanner

Run an Analysis with other Analyzers

Maven and Ant can also be used to launch analysis on Erlang projects.

The plugin has been tested to work with SonarQube Community Version 8.9.0

Configuration

All available keys are available in SonarQube dashboard administration or in ErlangPlugin.java

EUnit report import

sonar.erlang.eunit.reportsfolder - sets the Eunit reports folder, .eunit by default.

sonar.erlang.eunit.coverdata.filename - sets the Eunit coverage report file name, eunit.coverdata by default.

Common Test report import

sonar.erlang.ct.coverdata.filename - sets the Common Test coverage file name, all.coverdata by default in project root. The easiest way to export this file is to use a cover spec file.

You can see an example of such a file HERE.

Check out how to configure Common Test for coverage in the sample Makefile.

Dialyzer and Xref

See issue about Dialyzer

sonar.erlang.xref.filename - sets Xref report file name, located in Eunit report folder. xref.log by default.

Development

The project uses Maven 3 and JDK 11 and above.

Build

Build the release plugin JAR with Maven

mvn clean package

You will find the built JAR in sonar-erlang-plugin/target/sonar-erlang-plugin.jar

Test

Run all unit tests with

mvn test

Integration testing

First, you can bring up a local SonarQube server instance using docker by running

docker compose up -d

This will run a SonarQube instance in Docker and mount necessary volumes.

To install the built plugin jar, you must copy it to the following path like so after mvn package:

cp ./sonar-erlang-plugin/target/sonar-erlang-plugin.jar ./sonar/extensions/plugins/sonar-erlang-plugin.jar

After that, access the server's dashboard (usually localhost:9000) with initial credentials admin:admin Then, restart the server instance and accept the loaded plugin.

Now, create a new project with the project key Erlang::erlcount and save the access token.

Finally, navigate to the sample project in sonar-erlang-plugin/src/test/resources/org/sonar/plugins/erlang/erlcount and run the sonar-scanner CLI:

sonar-scanner -Dsonar.login=<YOUR-TOKEN>

Once the scan is complete, you can view the results of the analysis in the dashboard, or fetch the metrics using the web API.

Contributing

Simply create a new GitHub Issue in 2 categories: suggestion, or a bug report. If possible, include any useful data like logs, examples, code etc.

sonar-erlang's People

Contributors

kalidasya avatar arthepsy avatar godin avatar lindamartin avatar ehartmann avatar hegedenes avatar danirukun avatar dbolkensteyn avatar marcphilipp avatar benzonico avatar ayazflogmein avatar dgageot avatar joaohf avatar vmx avatar christophelevis avatar ganncamp avatar ganntest avatar mpaladin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.