Difference between revisions of "Including Other Results"

From Lingoport Wiki
Jump to: navigation, search
(Viewing it on the Dashboard)
(Viewing it on the Dashboard)
Line 52: Line 52:
   
 
[[File:MultiProgrammingLanguages.png|700px|center]]
 
[[File:MultiProgrammingLanguages.png|700px|center]]
  +
  +
You can now click on each module to see its results. Let's click on the Lingoport module:

Revision as of 20:56, 28 January 2016

Context

The Globalyzer and LRM issues are shown on the Dashboard using a specific Quality Profile and a number of plugins on the SonarQube platform. You may have other checks running on your code which you would like to report on the Dashboard, or vice-versa, you may have a SonarQube Platform on which you may want to add Globalization tracking from Lingoport.

A Quality Profile is a set of checks set up for a given programming language. (See http://docs.sonarqube.org/display/SONAR/Quality+Profiles ). Lingoport needs to cover a number of programming languages and we define the 'lport' language in order to associate globalization issue to the scanned code. A typical quality profile for Java is 'SonarWay'. In this illustrative example, we show how to have both Lingoport results and Java 'SonarWay' results on the same project.

Modules

When an application or a project in a repository has many programming languages, it is typical that some, say, C code is in a different module than, say, Java code. The SonarQube provides for setting up modules to cover different part of the repository with different programming language rules/quality profiles.

In our world, it is actually the same code which is analyzed by different sets of rules / quality profiles. So we need to set up modules on the same code, not in different modules. This may be confusing.

Example sonar-project.properties

In this example,

  • there will be two modules, lingoport and java
  • the project source is located at /var/lib/jenkins/World-Wind-Java-Multi and each module will point to that location
  • the GlobalyzerScans and LRMScan is located right under that top level directory, hence the "." for sonar.lingoport.project.root
  • The GlobalyzerScans and LRMScans directory are excluded from any analysis, hence the value for sonar.exclusions

Here is what the file looks like:

#Example of the sonar-project.properties file that is located in the base project folder.
#The LRMScans and GlobalyzerScans folder are also located at the same level
# Multi-languages are defined (lport and java)

# Modules inherit properties set at parent level
sonar.projectKey=WorldWindJavaMultiLang:scan
sonar.projectName=WorldWindJavaMultiLang
sonar.projectVersion=1.0
sonar.sourceEncoding=UTF-8
sonar.exclusions=**/LRMScans/*.*, **/GlobalyzerScans/*.*

# Set modules IDs
sonar.modules=lingoport,java

# Module Lingoport
lingoport.sonar.language=lport
lingoport.sonar.sources=/var/lib/jenkins/World-Wind-Java-Multi
lingoport.sonar.projectBaseDir=/var/lib/jenkins/World-Wind-Java-Multi

#Module java
java.sonar.language=java
java.sonar.sources=/var/lib/jenkins/World-Wind-Java-Multi
java.sonar.projectBaseDir=/var/lib/jenkins/World-Wind-Java-Multi


# -- Lingoport specific attributes --
sonar.lingoport.project.root=.

Viewing it on the Dashboard

Once sonar-runner is successfully run and the Dashboard is updated, it will show the two modules:

MultiProgrammingLanguages.png

You can now click on each module to see its results. Let's click on the Lingoport module: