In this section:
Parasoft Multi-Language Pack is a collection of extensions that enable you to integrate your third-party code analysis tools with Parasoft DTP. The Multi-Language Pack performs the following actions:
DTP presents the data in widgets, reports, and other interfaces that enable you to prioritize violations, place them into remediation workflows, and monitor progress toward improving the code quality. Benefits of using the Multi-Language Pack include:
The following third-party analysis tools are currently supported:
DISPLAY
variable must be set and access control must be disabled for the xhost
command (run xhost +
). This is required to ensure that overview images in HTML reports display correctly.Extract the Multi-Language Pack distribution to a directory that is accessible to non-administrator users. If you must install the pack into an admin-only directory (for example, /opt/multi-language) and MLP will be run by non-admin user, you will need to create additional subdirectories and apply appropriate permissions:
.mlp
directory in the Multi-Language Pack installation directory (<INSTALL>/.mlp) and give non-admin users write access. This is where log files will be saved.reports
directory in the Multi-Language Pack installation directory (<INSTALL>/reports) and give non-admin users write access. This is where the pack will save reports it generates. You can license and configure the Multi-Language Pack by configuring the settings in the settings.properties file located in the installation directory.
You can set either a network or local license.
The network license is retrieved from Parasoft DTP. See Connecting to DTP information on how to connect to Parasoft DTP.
The local license password is provided by your Parasoft representative. To use a local license, edit the settings.properties file located in the installation directory and specify the following properties:
mlp.license.use_network=false mlp.license.local.password=<license-password> |
Set the following property to accept the Parasoft End User License Agreement (please read the EULA at https://www.parasoft.com/license):
parasoft.eula.accepted=true |
Configure your DTP settings to acquire a license and to send code analysis execution results to DTP. Specify the following settings in the settings.properties file located in the installation directory:
Specifies the URL to your DTP server. Remember to include the https://
protocol; DTP requires https://
connections from other Parasoft tools.
Specifies the username for DTP authentication.
Specifies the user password for DTP authentication. You can encode your DTP password by running the multilanguage-pack.sh or .bat with the encodepass parameter
. For example:
./multilanguage-pack.sh -encodepass mypassword
Specifies the name of the existing DTP project that you want to link to. This setting is optional for running the Multi-Language Pack, but required if you want to view results in DTP.
dtp.server=myhost dtp.port=8443 dtp.user=admin dtp.password=admin dtp.project=my_project |
See Additional Configuration for more configuration options.
Connecting to source control allows you to leverage the Multi-Language Pack to determine the authors of reported violations. With source control settings properly configured, the Multi-Language Pack can query for authors of the code lines where defects were detected by the static code analyzers.
To connect to source control, specify your source control system-specific settings in the settings.properties file located in the Multi-Language Pack installation directory. See Additional Settings for the list of source control settings.
The following example shows the settings required to connect to Git:
scontrol.rep.type=git scontrol.rep.git.url=https://mygit.mycompanycom/myrepo/myrepo.git scontrol.rep.git.branch=master scontrol.rep.git.workspace=c:\\development\\workspace\\JavaScript\\myrepo |
If you are going to retrieve authorship information from Git, the cloned repository should not be shallow. A Git repository is considered shallow if the file |
multilanguage-pack.bat -tool <tool> -results.file "<path to analysis results file>" -source.dir "<path to source code>" |
Internal technical log files from the Multi-Language Pack execution are generated in the <INSTALL>/.mlp subdirectory.
The following parameters are required.
This parameter specifies the third-party code analysis tools you want to execute. One of the following values is required:
androidlint
goreporter
jshint
oclint
phpmpd
pmd
pylint
rubocop
scalastyle
sonarqube
swiftlint
tslint
This parameter specifies the path to the results file generated by the third-party analysis tool.
This parameter specifies the path to the source code of the project analyzed by third-party code analysis tools. This is used to collect source control metadata (e.g., authorship, last updated, etc.) for DTP reporting and processing.
The following parameters are not required.
By default, the Multi-Language Pack will reference to the settings.properties file in the installation directory, but you can use this setting to point to alternate configuration files. Example:
settings=C:\my-team-configs\my-settings.properties
./multilanguage-pack.sh -tool scalastyle -results.file "/Projects/MyProject/scalastyle-results.xml" -source.dir "/Projects/MyProject/src" |
After executing the Multi-Language Pack, results are output in two ways:
You can also configure the Multi-Language Pack to email reports to project team members (see Report Settings).
The local HTML report (and XML data that feeds the report) are saved to the <INSTALL>/reports directory after execution. The following sections are included in the report by default.
The first part of the report covers the static analysis findings. A finding is a static analysis violation originally detected by the third-party static analysis tool (JSHint, Scalastyle, etc.) and processed by the Multi-Language Pack to include code authorship metadata.
Findings are displayed in the report as a color-coded pie chart indicating different severity types. Different analysis tools have different systems for assigning severities to violations. In many instances, all violations may be assigned to single severity, such as Severity 3, by default. You can change the severities associated with specific code analysis rules to meet your development objectives. See Customizing Rule Details and Metadata for details.
This section presents findings from several perspectives, including findings by severity, author, and file.
You can navigate the analyzed code to the reported findings in the Findings by File section. Each node begins with a value that indicates the total number of findings in the node. The value in brackets shows the number of suppressed rules in the node. You can click nodes marked with a plus sign (+) to expand them.
The setup problems section reports errors that may have affected execution and/or data collection. The test parameters section outputs the full command used to run the Multi-Language Pack.
Open a dashboard in DTP and choose a filter associated with your project from the Filter drop-down menu. A filter named after the project is added to each project in DTP by default. If your DTP administrator has not set up filters, then your filter will be Project Name> Project Name. See dtp.project for information on connecting to your project.
You may also need to select the correct build ID form the Target Build drop-down menu. This will only be necessary if there are several build IDs associated with the project. Refer to DTP Concepts in the DTP documentation for background information about build IDs, filters, and other concepts associated with DTP.
If your dashboard already has static analysis widgets configured to view data according to the dashboard settings, then you will see the results.
You can also click on widgets to open additional interfaces, such as the Violations Explorer to prioritize violations, assign them to team members for remediation, and more.
Refer to the DTP documentation on docs.parasoft.com for details on using the features in DTP.