diff --git a/images/3.8_selectFolder.png b/images/3.8_selectFolder.png deleted file mode 100644 index 01eaf86b8..000000000 Binary files a/images/3.8_selectFolder.png and /dev/null differ diff --git a/images/3.8_selectProject.png b/images/3.8_selectProject.png deleted file mode 100644 index 04b2b3bbc..000000000 Binary files a/images/3.8_selectProject.png and /dev/null differ diff --git a/images/add-binding.png b/images/add-binding.png deleted file mode 100644 index f097a157d..000000000 Binary files a/images/add-binding.png and /dev/null differ diff --git a/images/connected_mode_treeview.png b/images/connected_mode_treeview.png deleted file mode 100644 index a30a3d258..000000000 Binary files a/images/connected_mode_treeview.png and /dev/null differ diff --git a/images/connection_success.png b/images/connection_success.png deleted file mode 100644 index 2e4eaf239..000000000 Binary files a/images/connection_success.png and /dev/null differ diff --git a/images/create_view.png b/images/create_view.png deleted file mode 100644 index d42c3295c..000000000 Binary files a/images/create_view.png and /dev/null differ diff --git a/images/edit-binding.png b/images/edit-binding.png deleted file mode 100644 index 813e384ea..000000000 Binary files a/images/edit-binding.png and /dev/null differ diff --git a/images/severity/blocker.png b/images/severity/blocker.png deleted file mode 100644 index 96e52eae7..000000000 Binary files a/images/severity/blocker.png and /dev/null differ diff --git a/images/severity/blocker.svg b/images/severity/blocker.svg new file mode 100644 index 000000000..df5750a1b --- /dev/null +++ b/images/severity/blocker.svg @@ -0,0 +1,3 @@ + diff --git a/images/severity/critical.png b/images/severity/critical.png deleted file mode 100644 index 354276b0d..000000000 Binary files a/images/severity/critical.png and /dev/null differ diff --git a/images/severity/critical.svg b/images/severity/critical.svg new file mode 100644 index 000000000..1050651f4 --- /dev/null +++ b/images/severity/critical.svg @@ -0,0 +1,3 @@ + diff --git a/images/severity/info.png b/images/severity/info.png deleted file mode 100644 index 6a40eceee..000000000 Binary files a/images/severity/info.png and /dev/null differ diff --git a/images/severity/info.svg b/images/severity/info.svg new file mode 100644 index 000000000..3ed2bf90b --- /dev/null +++ b/images/severity/info.svg @@ -0,0 +1,3 @@ + diff --git a/images/severity/major.png b/images/severity/major.png deleted file mode 100644 index 6984dd022..000000000 Binary files a/images/severity/major.png and /dev/null differ diff --git a/images/severity/major.svg b/images/severity/major.svg new file mode 100644 index 000000000..e553cba4d --- /dev/null +++ b/images/severity/major.svg @@ -0,0 +1,3 @@ + diff --git a/images/severity/minor.png b/images/severity/minor.png deleted file mode 100644 index 71519d941..000000000 Binary files a/images/severity/minor.png and /dev/null differ diff --git a/images/severity/minor.svg b/images/severity/minor.svg new file mode 100644 index 000000000..925ba8d8c --- /dev/null +++ b/images/severity/minor.svg @@ -0,0 +1,3 @@ + diff --git a/images/type/bug.png b/images/type/bug.png deleted file mode 100644 index 5862bff7b..000000000 Binary files a/images/type/bug.png and /dev/null differ diff --git a/images/type/bug.svg b/images/type/bug.svg new file mode 100644 index 000000000..b4aa01e71 --- /dev/null +++ b/images/type/bug.svg @@ -0,0 +1,8 @@ + diff --git a/images/type/code_smell.png b/images/type/code_smell.png deleted file mode 100644 index 8fa403cb9..000000000 Binary files a/images/type/code_smell.png and /dev/null differ diff --git a/images/type/code_smell.svg b/images/type/code_smell.svg new file mode 100644 index 000000000..dce483c4b --- /dev/null +++ b/images/type/code_smell.svg @@ -0,0 +1,5 @@ + diff --git a/images/type/security_hotspot.png b/images/type/security_hotspot.png deleted file mode 100644 index 89df08620..000000000 Binary files a/images/type/security_hotspot.png and /dev/null differ diff --git a/images/type/vulnerability.png b/images/type/vulnerability.png deleted file mode 100644 index 532746b67..000000000 Binary files a/images/type/vulnerability.png and /dev/null differ diff --git a/images/type/vulnerability.svg b/images/type/vulnerability.svg new file mode 100644 index 000000000..fb25da6c7 --- /dev/null +++ b/images/type/vulnerability.svg @@ -0,0 +1,5 @@ + diff --git a/package-lock.json b/package-lock.json index d13f7b369..a8036473f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,7 @@ "tar": "^7.2.0", "underscore": "^1.13.6", "vscode-languageclient": "^8.0.2", + "xmldom": "^0.6.0", "zlib": "^1.0.5" }, "devDependencies": { @@ -6695,6 +6696,15 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/xmldom": { + "version": "0.6.0", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/xmldom/-/xmldom-0.6.0.tgz", + "integrity": "sha512-iAcin401y58LckRZ0TkI4k0VSM1Qg0KGSc3i8rU+xrxe19A/BN1zHyVSJY7uoutVlaTSzYyk/v5AmkewAP7jtg==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/xtend/-/xtend-4.0.2.tgz", diff --git a/package.json b/package.json index 1f3a46e27..9add0988d 100644 --- a/package.json +++ b/package.json @@ -886,6 +886,7 @@ "tar": "^7.2.0", "underscore": "^1.13.6", "vscode-languageclient": "^8.0.2", + "xmldom": "^0.6.0", "zlib": "^1.0.5" }, "devDependencies": { diff --git a/src/rules/rulepanel.ts b/src/rules/rulepanel.ts index 7460dadf8..b53d7cd74 100644 --- a/src/rules/rulepanel.ts +++ b/src/rules/rulepanel.ts @@ -14,6 +14,8 @@ import * as util from '../util/util'; import { clean, escapeHtml, ResourceResolver } from '../util/webview'; import { decorateContextualHtmlContentWithDiff } from './code-diff'; import { highlightAllCodeSnippetsInDesc } from './syntax-highlight'; +import * as fs from 'fs'; +import { DOMParser, XMLSerializer } from 'xmldom'; let ruleDescriptionPanel: VSCode.WebviewPanel; @@ -111,6 +113,27 @@ function renderImpact(softwareQuality: string, severity: string, resolver: Resou `; } +function renderStandardModeSeverityDetails(ruleType: string, severity: string, resolver: ResourceResolver) { + const ruleTypeToLowerCase = ruleType.toLocaleLowerCase('en-us'); + const severityToLowerCase = severity.toLocaleLowerCase('en-us'); + const ruleTypeImgSrc = util.resolveExtensionFile('images', 'type', `${ruleTypeToLowerCase}.svg`); + const severityImgSrc = util.resolveExtensionFile('images', 'severity', `${severityToLowerCase}.svg`); + return `