Skip to content

Commit d12f90e

Browse files
Merge pull request #88 from unapplicable/override-phrases
Add options to override phrases in report
2 parents 4518875 + 59db98c commit d12f90e

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

index.ejs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<head>
55
<meta charset="UTF-8">
6-
<title>SonarQube Vulnerability Report</title>
6+
<title>SonarQube <%= vulnerabilityPhrase %> Report</title>
77
<style>
88
/*
99
The sss stylesheet is released under the MIT license.
@@ -159,7 +159,7 @@
159159
</p>
160160
-->
161161

162-
<h1>SonarQube Vulnerability Report</h1>
162+
<h1>SonarQube <%= vulnerabilityPhrase %> Report</h1>
163163

164164
<dl>
165165
<dt>Report Generated On</dt>
@@ -185,7 +185,7 @@
185185
<% } %>
186186
</dl>
187187

188-
<h2>Summary of the Detected Vulnerabilities</h2>
188+
<h2>Summary of the Detected <%= vulnerabilityPluralPhrase %></h2>
189189
<table>
190190
<thead>
191191
<tr>
@@ -225,7 +225,7 @@
225225

226226
<div class=detail>
227227
<%if (issues.length > 0) { %>
228-
<h2>Detail of the Detected Vulnerabilities</h2>
228+
<h2>Detail of the Detected <%= vulnerabilityPluralPhrase %></h2>
229229
<table>
230230
<thead>
231231
<tr>

index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ DESCRIPTION
6363
--noSecurityHotspot
6464
Set this flag for old versions of sonarQube without security hotspots (<7.3). Default is false
6565
66+
--vulnerabilityPhrase
67+
Set to override 'Vulnerability' phrase in the report. Default 'Vulnerability'
68+
69+
--vulnerabilityPluralPhrase
70+
Set to override 'Vulnerabilities' phrase in the report. Default 'Vulnerabilities'
71+
6672
--help
6773
display this help message`);
6874
process.exit();
@@ -100,6 +106,8 @@ function logError(context, error){
100106
allBugs: (argv.allbugs == 'true'),
101107
fixMissingRule: (argv.fixMissingRule == 'true'),
102108
noSecurityHotspot: (argv.noSecurityHotspot == 'true'),
109+
vulnerabilityPhrase: argv.vulnerabilityPhrase || 'Vulnerability',
110+
vulnerabilityPluralPhrase: argv.vulnerabilityPluralPhrase || 'Vulnerabilities',
103111
// sonar URL without trailing /
104112
sonarBaseURL: argv.sonarurl.replace(/\/$/, ""),
105113
sonarOrganization: argv.sonarorganization,

0 commit comments

Comments
 (0)