Ravaan Techky

Ravaan Techky Group invites all Techkies.

Sonar Report Plugins

Sonar Plugins help to download sonar scanning reports in the form of HTML / PDF which we can share with audience.

Overview:

Sonar Report Plugin help to download sonar scanning reports with the help of filters such as,- Types, Resolutions, Severities, Projects and DateRange. We can give sonarqube server url in report-plugin.properties file. With the help of filters and sonarqube server configuration tool fetch JSON response from server. Once tool receive JSON response from server it convert json response to XML format and apply XSLT to generate HTML / PDF report.

Project Layers:

Layers Available Technology
Client side layer No Not Applicable
Cascade style layer Yes XSLT
Server Web layer No Not Applicable
Service layer Yes Core Java
Database layer No Not Applicable

Technology Stack :

Technology Version
Core Java Adopt Open JDK (11.0.7)
Maven Apache Maven 3.5.0
XSLT 2.0
SonarQube Server 7.7 Community Edition

Benifits:

  • Reporting
    • Download sonar scanning reports in the form of HTML / PDF which we can share with audience
    • Keep track of sonar scanning issue as we have list of all open / resolved / closed issue.

Architecture Overview:

Overview

Tool configuration:

  • Edit **report-plugin.properties** file
    #sonar qube server URL.
    sonar.qube.server.url=http://SONAR_QUBE_SERVER_HOSTNAME:PORT/
    #report xml stylesheet template.
    report.xslt.template=../conf/Report.xsl
    #report output file name.
    report.output.file=../conf/OutputXMLReport.html
    #supported formats - html, xml, pdf
    report.output.format=html
    
  • Edit **FilterMapper.xml** file

<!-- This Filter used to fetch requirement specific data from SonarQube server. -->
<Filter>
  <!-- Types node value contains comma separated issue type. 
       BUG indicate sonar reported bug. 
       VULNERABILITY indicate sonar reported vulnerabilities. 
       If we keep Types node value is blank then it will show all types of sonar reported issue.
  -->
	<Types>BUG,VULNERABILITY</Types>

  <!-- Resolutions node value contains comma separated resolutions of sonar reported issue. 
       OPEN indicates sonar reported issue whose implementation status is currently Open. 
       FALSE-POSITIVE indicates sonar reported issue's implementation status is currently marked as false positive by developer. 
       WONTFIX indicates sonar reported issue is as per designed and we can't able to fix this.
       FIXED indicates sonar reported issue is Fixed.
       CLOSED indicates sonar reported issue is Fixed and after sonar scann it gets validated and marked as Closed. 
       If we keep Resolutions node value is blank then it will show all resolutions sonar reported issue.
  -->
	<Resolutions>FALSE-POSITIVE,WONTFIX,FIXED,REMOVED</Resolutions>

  <!-- 
  	Severities node value contains comma separated severity.
	BLOCKER indicates critical and blocker sonar reported issue.
	MAJOR indicates high level sonar reported issue.
	MINOR indicates low level sonar reported issue.
  -->
	<Severities>BLOCKER</Severities>

  <!-- 
  	Projects node value contains project name mentioned in sonarqube. This value is dervied from maven project group and artifact id.
  -->
	<Projects></Projects>

  <!-- 
  	DateRange node value contains start date and end date to find out sonar reported issue with this range.
	CreatedAfter format is YYYY-mm-dd example, - 2019-01-15
	CreatedBefore format is YYYY-mm-dd example, - 2019-02-15
	CreatedAfter date should be older than CreatedBefore
  -->
	<DateRange>
		<CreatedAfter>2019-02-03</CreatedAfter>
		<CreatedBefore>2019-02-15</CreatedBefore>
	</DateRange>
</Filter>
  • Edit **Report.xsl** file ```markdown This is XSLT file which use to generate HTML report. Same HTML format is used in PDF file.

Sample XSLT template is available in ${project.directory}/conf/Report.xsl

```

Description Link
Source Code
Circle CI Not Available
Documentation

Sample Reports:

Report Type Link
HTML
PDF
XML

Developer Information:

Description Github Profile Link LinkedIn Profile Link Email Address
Vaishali Patil ravaan.techky@gmail.com



Back


sonar-plugins is maintained by ravaan-techky.