diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index c7fc933..a7043e1 100755
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -2,6 +2,7 @@
# libraries
annotations = "24.0.1"
jackson = "2.15.2"
+markdown = "0.6.1"
# plugins
dokka = "1.9.10"
@@ -13,6 +14,7 @@ kover = "0.7.3"
[libraries]
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
jackson = { group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin", version.ref = "jackson" }
+markdown = { group = "org.jetbrains", name = "markdown", version.ref = "markdown" }
[plugins]
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
diff --git a/src/main/kotlin/com/cycode/plugin/cli/models/scanResult/sca/ScaDetectionDetails.kt b/src/main/kotlin/com/cycode/plugin/cli/models/scanResult/sca/ScaDetectionDetails.kt
index 92a883e..b5305b8 100644
--- a/src/main/kotlin/com/cycode/plugin/cli/models/scanResult/sca/ScaDetectionDetails.kt
+++ b/src/main/kotlin/com/cycode/plugin/cli/models/scanResult/sca/ScaDetectionDetails.kt
@@ -9,7 +9,7 @@ data class ScaDetectionDetails(
val line: Int,
val lineInFile: Int,
val dependencyPaths: String,
- val licence: String?,
+ val license: String?,
val packageName: String,
val packageVersion: String,
val vulnerabilityDescription: String?,
diff --git a/src/main/kotlin/com/cycode/plugin/components/common/ClickableLabel.kt b/src/main/kotlin/com/cycode/plugin/components/common/ClickableLabel.kt
index 89474fb..8d6acb2 100644
--- a/src/main/kotlin/com/cycode/plugin/components/common/ClickableLabel.kt
+++ b/src/main/kotlin/com/cycode/plugin/components/common/ClickableLabel.kt
@@ -1,6 +1,6 @@
package com.cycode.plugin.components.common
-import com.intellij.ide.BrowserUtil
+import com.cycode.plugin.components.openURL
import com.intellij.ui.HyperlinkLabel
fun createClickableLabel(htmlContent: String): HyperlinkLabel {
@@ -24,7 +24,3 @@ fun extractUrlFromHtml(html: String): String? {
val match = regex.find(html)
return match?.groupValues?.getOrNull(1)
}
-
-fun openURL(url: String) {
- BrowserUtil.browse(url)
-}
diff --git a/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/ScaViolationCardContentTab.kt b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/ScaViolationCardContentTab.kt
new file mode 100644
index 0000000..d0ae0d6
--- /dev/null
+++ b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/ScaViolationCardContentTab.kt
@@ -0,0 +1,50 @@
+package com.cycode.plugin.components.toolWindow.components.scaViolationCardContentTab
+
+import com.cycode.plugin.cli.models.scanResult.sca.ScaDetection
+import com.cycode.plugin.components.toolWindow.components.scaViolationCardContentTab.components.header.ScaHeader
+import com.cycode.plugin.components.toolWindow.components.scaViolationCardContentTab.components.shortSummary.ScaShortSummary
+import com.cycode.plugin.components.toolWindow.components.scaViolationCardContentTab.components.summary.ScaSummary
+import com.cycode.plugin.components.toolWindow.components.scaViolationCardContentTab.components.title.ScaTitle
+import com.intellij.util.ui.JBUI
+import java.awt.GridBagConstraints
+import java.awt.GridBagLayout
+import javax.swing.JComponent
+import javax.swing.JPanel
+
+class ScaViolationCardContentTab {
+ fun getContent(detection: ScaDetection): JComponent {
+ val titlePanel = ScaTitle().getContent(detection)
+ val shortSummaryPanel = ScaShortSummary().getContent(detection)
+ val headerContentPanel = ScaHeader().getContent(detection)
+ val summaryPanel = ScaSummary().getContent(detection)
+
+ val gbc = GridBagConstraints()
+ gbc.fill = GridBagConstraints.BOTH
+ gbc.anchor = GridBagConstraints.NORTHWEST
+ gbc.gridx = 0
+ gbc.weightx = 1.0
+ gbc.weighty = 0.0
+ gbc.insets = JBUI.insetsBottom(10)
+
+ val panel = JPanel(GridBagLayout())
+
+ gbc.gridy++
+ panel.add(titlePanel, gbc)
+
+ gbc.gridy++
+ panel.add(shortSummaryPanel, gbc)
+
+ gbc.gridy++
+ panel.add(headerContentPanel, gbc)
+
+ gbc.gridy++
+ panel.add(summaryPanel, gbc.apply {
+ weighty = 1.0 // Expand the summary panel to fill the remaining space
+ })
+
+ // FIXME(MarshalX): something gives left border already. that's why left != right here
+ panel.border = JBUI.Borders.empty(10, 2, 0, 10)
+
+ return panel
+ }
+}
diff --git a/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/components/header/ScaHeader.kt b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/components/header/ScaHeader.kt
new file mode 100644
index 0000000..b51057a
--- /dev/null
+++ b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/components/header/ScaHeader.kt
@@ -0,0 +1,68 @@
+package com.cycode.plugin.components.toolWindow.components.scaViolationCardContentTab.components.header
+
+import com.cycode.plugin.CycodeBundle
+import com.cycode.plugin.cli.models.scanResult.sca.ScaDetection
+import com.intellij.ui.JBColor
+import com.intellij.ui.components.JBLabel
+import com.intellij.util.ui.JBUI
+import java.awt.GridBagConstraints
+import java.awt.GridBagLayout
+import javax.swing.JComponent
+import javax.swing.JLabel
+import javax.swing.JPanel
+
+class ScaHeader {
+ private val gbc = GridBagConstraints()
+ private val panel: JPanel = JPanel(GridBagLayout())
+
+ private fun addHeader(label: String, value: String) {
+ gbc.gridy++
+
+ panel.add(JLabel(label), gbc.apply {
+ gridx = 0
+ weightx = 0.125
+ })
+ panel.add(JBLabel(value).apply { setAllowAutoWrapping(true); setCopyable(true) }, gbc.apply {
+ gridx = 1
+ weightx = 0.875
+ anchor = GridBagConstraints.NORTHWEST
+ })
+ }
+
+ fun getContent(detection: ScaDetection): JComponent {
+ gbc.fill = GridBagConstraints.HORIZONTAL
+ gbc.anchor = GridBagConstraints.NORTHWEST
+ gbc.insets = JBUI.insets(2)
+
+ addHeader(CycodeBundle.message("scaViolationCardHeaderPackageField"), detection.detectionDetails.packageName)
+ addHeader(CycodeBundle.message("scaViolationCardHeaderVersionField"), detection.detectionDetails.packageVersion)
+
+ if (detection.detectionDetails.alert != null) {
+ val patchedVersion = detection.detectionDetails.alert.firstPatchedVersion
+ ?: CycodeBundle.message("scaViolationCardHeaderPatchedVersionDefaultValue")
+ addHeader(CycodeBundle.message("scaViolationCardHeaderPatchedVersionField"), patchedVersion)
+ }
+
+ if (detection.detectionDetails.dependencyPaths.isNotEmpty()) {
+ addHeader(
+ CycodeBundle.message("scaViolationCardHeaderDependencyPathField"),
+ detection.detectionDetails.dependencyPaths
+ )
+ }
+
+ if (detection.detectionDetails.alert == null) {
+ // if non-permissive-license
+ addHeader(
+ CycodeBundle.message("scaViolationCardHeaderLicenseField"),
+ detection.detectionDetails.license ?: CycodeBundle.message("scaViolationCardHeaderLicenseDefaultValue")
+ )
+ }
+
+ panel.border = JBUI.Borders.compound(
+ JBUI.Borders.customLine(JBColor.GRAY, 1, 0, 1, 0),
+ JBUI.Borders.empty(10, 0)
+ )
+
+ return panel
+ }
+}
diff --git a/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/components/shortSummary/ScaShortSummary.kt b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/components/shortSummary/ScaShortSummary.kt
new file mode 100644
index 0000000..fe11848
--- /dev/null
+++ b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/components/shortSummary/ScaShortSummary.kt
@@ -0,0 +1,30 @@
+package com.cycode.plugin.components.toolWindow.components.scaViolationCardContentTab.components.shortSummary
+
+import com.cycode.plugin.CycodeBundle
+import com.cycode.plugin.cli.models.scanResult.sca.ScaDetection
+import com.intellij.ui.components.JBLabel
+import java.awt.GridBagConstraints
+import java.awt.GridBagLayout
+import javax.swing.JComponent
+import javax.swing.JPanel
+
+class ScaShortSummary {
+ fun getContent(detection: ScaDetection): JComponent {
+ val gbc = GridBagConstraints()
+ gbc.fill = GridBagConstraints.NONE
+ gbc.anchor = GridBagConstraints.NORTHWEST
+ gbc.weightx = 1.0
+
+ val panel = JPanel(GridBagLayout())
+
+ if (detection.detectionDetails.alert != null) {
+ val cwe = detection.detectionDetails.vulnerabilityId
+ val severity = detection.severity
+ val shortSummary = CycodeBundle.message("scaViolationCardShortSummary", severity, cwe ?: "")
+
+ panel.add(JBLabel(shortSummary).apply { setAllowAutoWrapping(true); setCopyable(true) }, gbc)
+ }
+
+ return panel
+ }
+}
diff --git a/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/components/summary/ScaSummary.kt b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/components/summary/ScaSummary.kt
new file mode 100644
index 0000000..45e276e
--- /dev/null
+++ b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/components/summary/ScaSummary.kt
@@ -0,0 +1,86 @@
+package com.cycode.plugin.components.toolWindow.components.scaViolationCardContentTab.components.summary
+
+import com.cycode.plugin.CycodeBundle
+import com.cycode.plugin.cli.models.scanResult.sca.ScaDetection
+import com.cycode.plugin.components.toolWindow.components.scaViolationCardContentTab.convertMarkdownToHtml
+import com.intellij.ui.BrowserHyperlinkListener
+import com.intellij.ui.components.JBLabel
+import com.intellij.util.ui.JBFont
+import com.intellij.util.ui.JBUI
+import com.intellij.util.ui.UIUtil
+import java.awt.GridBagConstraints
+import java.awt.GridBagLayout
+import javax.swing.JComponent
+import javax.swing.JEditorPane
+import javax.swing.JPanel
+import javax.swing.JScrollPane
+import javax.swing.text.DefaultCaret
+
+class ScaSummary {
+ private fun getDescription(detection: ScaDetection): String {
+ val descriptionMarkdown = detection.detectionDetails.alert?.description ?: ""
+ return convertMarkdownToHtml(descriptionMarkdown)
+ }
+
+ fun getContent(detection: ScaDetection): JComponent {
+ val description = getDescription(detection)
+
+ val editorPane = JEditorPane().apply {
+ contentType = "text/html"
+ isEditable = false
+ isOpaque = false
+ background = UIUtil.TRANSPARENT_COLOR
+ }
+
+ editorPane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, true)
+ editorPane.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE)
+
+ (editorPane.caret as DefaultCaret).updatePolicy = DefaultCaret.NEVER_UPDATE
+
+ editorPane.editorKit = UIUtil.getHTMLEditorKit()
+ editorPane.text = description
+
+ // reset scroll position to top
+ editorPane.caretPosition = 0
+
+ editorPane.border = null
+
+ val panel = JPanel(GridBagLayout()).apply {
+ add(
+ JScrollPane(
+ editorPane,
+ JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
+ JScrollPane.HORIZONTAL_SCROLLBAR_NEVER
+ ).apply { border = null },
+ GridBagConstraints().apply {
+ fill = GridBagConstraints.BOTH
+ anchor = GridBagConstraints.NORTHWEST
+ weightx = 1.0
+ weighty = 1.0
+ gridy = 1
+ }
+ )
+ }
+
+ if (detection.detectionDetails.alert?.description != null) {
+ // we don't want to show the summary label if there is no description
+ // editor pane still required to acquire the space on the card panel
+
+ panel.add(
+ JBLabel(CycodeBundle.message("scaViolationCardSummaryTitle")).apply {
+ font = font.deriveFont(18f).deriveFont(JBFont.BOLD)
+ },
+ GridBagConstraints().apply {
+ fill = GridBagConstraints.HORIZONTAL
+ anchor = GridBagConstraints.NORTHWEST
+ weightx = 1.0
+ weighty = 0.0
+ gridy = 0
+ insets = JBUI.insetsBottom(5)
+ }
+ )
+ }
+
+ return panel
+ }
+}
diff --git a/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/components/title/ScaTitle.kt b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/components/title/ScaTitle.kt
new file mode 100644
index 0000000..903f317
--- /dev/null
+++ b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/components/title/ScaTitle.kt
@@ -0,0 +1,55 @@
+package com.cycode.plugin.components.toolWindow.components.scaViolationCardContentTab.components.title
+
+import com.cycode.plugin.cli.models.scanResult.sca.ScaDetection
+import com.cycode.plugin.icons.PluginIcons
+import com.intellij.ui.components.JBLabel
+import com.intellij.util.ui.JBUI
+import java.awt.GridBagConstraints
+import java.awt.GridBagLayout
+import javax.swing.JComponent
+import javax.swing.JLabel
+import javax.swing.JPanel
+
+class ScaTitle {
+ private fun getSeverityIcon(detection: ScaDetection): JLabel {
+ val icon = when (detection.severity.toLowerCase()) {
+ "critical" -> PluginIcons.CARD_SEVERITY_CRITICAL
+ "high" -> PluginIcons.CARD_SEVERITY_HIGH
+ "medium" -> PluginIcons.CARD_SEVERITY_MEDIUM
+ "low" -> PluginIcons.CARD_SEVERITY_LOW
+ else -> PluginIcons.CARD_SEVERITY_INFO
+ }
+
+ return JLabel(icon)
+ }
+
+ fun getContent(detection: ScaDetection): JComponent {
+ val gbc = GridBagConstraints()
+ gbc.fill = GridBagConstraints.BOTH
+ gbc.anchor = GridBagConstraints.NORTHWEST
+ gbc.gridy = 0
+
+ val panel = JPanel(GridBagLayout())
+
+ val severityIcon = getSeverityIcon(detection)
+ val titleMessage = detection.detectionDetails.alert?.summary ?: detection.message
+ val title = JBLabel(titleMessage).apply {
+ setAllowAutoWrapping(true)
+ setCopyable(true)
+ font = font.deriveFont(18f)
+ }
+
+ panel.add(severityIcon, gbc.apply {
+ gridx = 0
+ weightx = 0.0
+ anchor = GridBagConstraints.CENTER
+ insets = JBUI.insets(5)
+ })
+ panel.add(title, gbc.apply {
+ gridx = 1
+ weightx = 1.0
+ })
+
+ return panel
+ }
+}
diff --git a/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/utils.kt b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/utils.kt
new file mode 100644
index 0000000..3b92f88
--- /dev/null
+++ b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/scaViolationCardContentTab/utils.kt
@@ -0,0 +1,11 @@
+package com.cycode.plugin.components.toolWindow.components.scaViolationCardContentTab
+
+import org.intellij.markdown.flavours.commonmark.CommonMarkFlavourDescriptor
+import org.intellij.markdown.html.HtmlGenerator
+import org.intellij.markdown.parser.MarkdownParser
+
+fun convertMarkdownToHtml(markdown: String): String {
+ val flavour = CommonMarkFlavourDescriptor()
+ val parsedTree = MarkdownParser(flavour).buildMarkdownTreeFromString(markdown)
+ return HtmlGenerator(markdown, parsedTree, flavour).generateHtml()
+}
diff --git a/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/treeView/TreeView.kt b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/treeView/TreeView.kt
index 00726af..2ce9269 100644
--- a/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/treeView/TreeView.kt
+++ b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/treeView/TreeView.kt
@@ -7,6 +7,8 @@ import com.cycode.plugin.cli.models.scanResult.DetectionBase
import com.cycode.plugin.cli.models.scanResult.ScanResultBase
import com.cycode.plugin.cli.models.scanResult.sca.ScaDetection
import com.cycode.plugin.cli.models.scanResult.secret.SecretDetection
+import com.cycode.plugin.components.toolWindow.components.scaViolationCardContentTab.ScaViolationCardContentTab
+import com.cycode.plugin.components.toolWindow.components.treeView.components.detectionNodeContextMenu.DetectionNodeContextMenu
import com.cycode.plugin.components.toolWindow.components.treeView.nodes.*
import com.cycode.plugin.icons.PluginIcons
import com.cycode.plugin.services.scanResults
@@ -64,7 +66,6 @@ class TreeView(
splitPane.firstComponent = treeView
splitPane.isShowDividerControls = true
- splitPane.isShowDividerIcon = true
if (defaultRightPane != null) {
splitPane.secondComponent = defaultRightPane
@@ -90,6 +91,8 @@ class TreeView(
}
private fun createMouseListeners(): MouseAdapter {
+ val treeView = this
+
return object : MouseAdapter() {
override fun mousePressed(e: MouseEvent) {
val selRow: Int = tree.getRowForLocation(e.x, e.y)
@@ -97,15 +100,15 @@ class TreeView(
if (selRow != -1 && selPath != null) {
// single right mouse click
if (e.button == MouseEvent.BUTTON3 && e.clickCount == 1) {
- DetectionNodeContextMenu(project, selPath).showPopup(e)
+ DetectionNodeContextMenu(treeView, project, selPath).showPopup(e)
}
}
}
}
}
- private fun displayScaViolationCard(node: ScaDetectionNode) {
- // not implemented yet
+ fun displayScaViolationCard(node: ScaDetectionNode) {
+ replaceRightPanel(ScaViolationCardContentTab().getContent(node.detection))
}
private fun convertSeverityToIcon(severity: String): Icon {
diff --git a/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/treeView/DetectionNodeContextMenu.kt b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/treeView/components/detectionNodeContextMenu/DetectionNodeContextMenu.kt
similarity index 86%
rename from src/main/kotlin/com/cycode/plugin/components/toolWindow/components/treeView/DetectionNodeContextMenu.kt
rename to src/main/kotlin/com/cycode/plugin/components/toolWindow/components/treeView/components/detectionNodeContextMenu/DetectionNodeContextMenu.kt
index cc03d4b..af8526e 100644
--- a/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/treeView/DetectionNodeContextMenu.kt
+++ b/src/main/kotlin/com/cycode/plugin/components/toolWindow/components/treeView/components/detectionNodeContextMenu/DetectionNodeContextMenu.kt
@@ -1,9 +1,12 @@
-package com.cycode.plugin.components.toolWindow.components.treeView
+package com.cycode.plugin.components.toolWindow.components.treeView.components.detectionNodeContextMenu
import com.cycode.plugin.CycodeBundle
+import com.cycode.plugin.components.toolWindow.components.treeView.TreeView
import com.cycode.plugin.components.toolWindow.components.treeView.nodes.ScaDetectionNode
import com.cycode.plugin.components.toolWindow.components.treeView.nodes.ScanTypeNode
import com.cycode.plugin.components.toolWindow.components.treeView.nodes.SecretDetectionNode
+import com.cycode.plugin.components.toolWindow.components.treeView.openScaDetectionInFile
+import com.cycode.plugin.components.toolWindow.components.treeView.openSecretDetectionInFile
import com.cycode.plugin.services.cycode
import com.intellij.openapi.editor.actions.ContentChooser.RETURN_SYMBOL
import com.intellij.openapi.project.Project
@@ -26,7 +29,11 @@ val RESCAN_OPTION = CycodeBundle.message("rescanOption")
val OPEN_IN_EDITOR_OPTION = CycodeBundle.message("openInEditorOption")
val OPEN_VIOLATION_CARD_OPTION = CycodeBundle.message("openViolationCardOption")
-class DetectionNodeContextMenu(private val project: Project, private val treePath: TreePath) {
+class DetectionNodeContextMenu(
+ private val treeView: TreeView,
+ private val project: Project,
+ private val treePath: TreePath
+) {
private val service = cycode(project)
private fun getUnknownNode(): Any {
@@ -41,7 +48,7 @@ class DetectionNodeContextMenu(private val project: Project, private val treePat
return when (getUnknownNode()) {
is ScanTypeNode -> listOf(RUN_OPTION)
is SecretDetectionNode -> listOf(OPEN_IN_EDITOR_OPTION, RESCAN_OPTION)
- is ScaDetectionNode -> listOf(OPEN_IN_EDITOR_OPTION, RESCAN_OPTION) // TODO (MarshalX): open violation card
+ is ScaDetectionNode -> listOf(OPEN_VIOLATION_CARD_OPTION, OPEN_IN_EDITOR_OPTION, RESCAN_OPTION)
else -> listOf()
}
}
@@ -90,7 +97,13 @@ class DetectionNodeContextMenu(private val project: Project, private val treePat
}
private fun onOpenViolationCardOptionClicked() {
- // TODO(MarshalX): implement
+ val node = getUnknownNode()
+ if (node !is ScaDetectionNode) {
+ // remove to implement more cards
+ return
+ }
+
+ treeView.displayScaViolationCard(node)
}
fun showPopup(e: MouseEvent) {
diff --git a/src/main/kotlin/com/cycode/plugin/components/utils.kt b/src/main/kotlin/com/cycode/plugin/components/utils.kt
new file mode 100644
index 0000000..1032458
--- /dev/null
+++ b/src/main/kotlin/com/cycode/plugin/components/utils.kt
@@ -0,0 +1,7 @@
+package com.cycode.plugin.components
+
+import com.intellij.ide.BrowserUtil
+
+fun openURL(url: String) {
+ BrowserUtil.browse(url)
+}
diff --git a/src/main/kotlin/com/cycode/plugin/icons/PluginIcons.kt b/src/main/kotlin/com/cycode/plugin/icons/PluginIcons.kt
index 4062be7..1c66161 100644
--- a/src/main/kotlin/com/cycode/plugin/icons/PluginIcons.kt
+++ b/src/main/kotlin/com/cycode/plugin/icons/PluginIcons.kt
@@ -8,16 +8,22 @@ import javax.swing.Icon
object PluginIcons {
val TOOL_WINDOW: Icon = load("/icons/toolWindowIcon.svg")
- val SCAN_TYPE_IAC: Icon = load("/icons/scan-type/IaC.png")
- val SCAN_TYPE_SAST: Icon = load("/icons/scan-type/SAST.png")
- val SCAN_TYPE_SCA: Icon = load("/icons/scan-type/SCA.png")
- val SCAN_TYPE_SECRETS: Icon = load("/icons/scan-type/Secrets.png")
-
- val SEVERITY_CRITICAL: Icon = load("/icons/severity/C.png")
- val SEVERITY_HIGH: Icon = load("/icons/severity/H.png")
- val SEVERITY_INFO: Icon = load("/icons/severity/I.png")
- val SEVERITY_LOW: Icon = load("/icons/severity/L.png")
- val SEVERITY_MEDIUM: Icon = load("/icons/severity/M.png")
+ val SCAN_TYPE_IAC: Icon = load("/icons/scan-type/IaC.svg")
+ val SCAN_TYPE_SAST: Icon = load("/icons/scan-type/SAST.svg")
+ val SCAN_TYPE_SCA: Icon = load("/icons/scan-type/SCA.svg")
+ val SCAN_TYPE_SECRETS: Icon = load("/icons/scan-type/Secrets.svg")
+
+ val SEVERITY_CRITICAL: Icon = load("/icons/severity/C.svg")
+ val SEVERITY_HIGH: Icon = load("/icons/severity/H.svg")
+ val SEVERITY_INFO: Icon = load("/icons/severity/I.svg")
+ val SEVERITY_LOW: Icon = load("/icons/severity/L.svg")
+ val SEVERITY_MEDIUM: Icon = load("/icons/severity/M.svg")
+
+ val CARD_SEVERITY_CRITICAL: Icon = load("/icons/card-severity/C.svg")
+ val CARD_SEVERITY_HIGH: Icon = load("/icons/card-severity/H.svg")
+ val CARD_SEVERITY_INFO: Icon = load("/icons/card-severity/I.svg")
+ val CARD_SEVERITY_LOW: Icon = load("/icons/card-severity/L.svg")
+ val CARD_SEVERITY_MEDIUM: Icon = load("/icons/card-severity/M.svg")
private fun load(path: String): Icon {
return IconLoader.getIcon(path, PluginIcons::class.java)
diff --git a/src/main/resources/icons/card-severity/C.svg b/src/main/resources/icons/card-severity/C.svg
new file mode 100644
index 0000000..a93d2c0
--- /dev/null
+++ b/src/main/resources/icons/card-severity/C.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/main/resources/icons/card-severity/H.svg b/src/main/resources/icons/card-severity/H.svg
new file mode 100644
index 0000000..4892d92
--- /dev/null
+++ b/src/main/resources/icons/card-severity/H.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/main/resources/icons/card-severity/I.svg b/src/main/resources/icons/card-severity/I.svg
new file mode 100644
index 0000000..b5a67e1
--- /dev/null
+++ b/src/main/resources/icons/card-severity/I.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/main/resources/icons/card-severity/L.svg b/src/main/resources/icons/card-severity/L.svg
new file mode 100644
index 0000000..8ce3b38
--- /dev/null
+++ b/src/main/resources/icons/card-severity/L.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/main/resources/icons/card-severity/M.svg b/src/main/resources/icons/card-severity/M.svg
new file mode 100644
index 0000000..a541f98
--- /dev/null
+++ b/src/main/resources/icons/card-severity/M.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/main/resources/icons/scan-type/IaC.png b/src/main/resources/icons/scan-type/IaC.png
deleted file mode 100644
index 5855c1d..0000000
Binary files a/src/main/resources/icons/scan-type/IaC.png and /dev/null differ
diff --git a/src/main/resources/icons/scan-type/IaC.svg b/src/main/resources/icons/scan-type/IaC.svg
new file mode 100644
index 0000000..9b0c844
--- /dev/null
+++ b/src/main/resources/icons/scan-type/IaC.svg
@@ -0,0 +1,4 @@
+
diff --git a/src/main/resources/icons/scan-type/SAST.png b/src/main/resources/icons/scan-type/SAST.png
deleted file mode 100644
index 7592b4a..0000000
Binary files a/src/main/resources/icons/scan-type/SAST.png and /dev/null differ
diff --git a/src/main/resources/icons/scan-type/SAST.svg b/src/main/resources/icons/scan-type/SAST.svg
new file mode 100644
index 0000000..abb3eec
--- /dev/null
+++ b/src/main/resources/icons/scan-type/SAST.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/main/resources/icons/scan-type/SCA.png b/src/main/resources/icons/scan-type/SCA.png
deleted file mode 100644
index 9c1536e..0000000
Binary files a/src/main/resources/icons/scan-type/SCA.png and /dev/null differ
diff --git a/src/main/resources/icons/scan-type/SCA.svg b/src/main/resources/icons/scan-type/SCA.svg
new file mode 100644
index 0000000..115b527
--- /dev/null
+++ b/src/main/resources/icons/scan-type/SCA.svg
@@ -0,0 +1,5 @@
+
diff --git a/src/main/resources/icons/scan-type/Secrets.png b/src/main/resources/icons/scan-type/Secrets.png
deleted file mode 100644
index d98a267..0000000
Binary files a/src/main/resources/icons/scan-type/Secrets.png and /dev/null differ
diff --git a/src/main/resources/icons/scan-type/Secrets.svg b/src/main/resources/icons/scan-type/Secrets.svg
new file mode 100644
index 0000000..abddd0d
--- /dev/null
+++ b/src/main/resources/icons/scan-type/Secrets.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/main/resources/icons/severity/C.png b/src/main/resources/icons/severity/C.png
deleted file mode 100644
index 9927bfa..0000000
Binary files a/src/main/resources/icons/severity/C.png and /dev/null differ
diff --git a/src/main/resources/icons/severity/C.svg b/src/main/resources/icons/severity/C.svg
new file mode 100644
index 0000000..e598e7b
--- /dev/null
+++ b/src/main/resources/icons/severity/C.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/main/resources/icons/severity/H.png b/src/main/resources/icons/severity/H.png
deleted file mode 100644
index 41e4fe8..0000000
Binary files a/src/main/resources/icons/severity/H.png and /dev/null differ
diff --git a/src/main/resources/icons/severity/H.svg b/src/main/resources/icons/severity/H.svg
new file mode 100644
index 0000000..f3f9556
--- /dev/null
+++ b/src/main/resources/icons/severity/H.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/main/resources/icons/severity/I.png b/src/main/resources/icons/severity/I.png
deleted file mode 100644
index a16cb97..0000000
Binary files a/src/main/resources/icons/severity/I.png and /dev/null differ
diff --git a/src/main/resources/icons/severity/I.svg b/src/main/resources/icons/severity/I.svg
new file mode 100644
index 0000000..94eb50a
--- /dev/null
+++ b/src/main/resources/icons/severity/I.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/main/resources/icons/severity/L.png b/src/main/resources/icons/severity/L.png
deleted file mode 100644
index 4778b63..0000000
Binary files a/src/main/resources/icons/severity/L.png and /dev/null differ
diff --git a/src/main/resources/icons/severity/L.svg b/src/main/resources/icons/severity/L.svg
new file mode 100644
index 0000000..f416edf
--- /dev/null
+++ b/src/main/resources/icons/severity/L.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/main/resources/icons/severity/M.png b/src/main/resources/icons/severity/M.png
deleted file mode 100644
index 7b805c3..0000000
Binary files a/src/main/resources/icons/severity/M.png and /dev/null differ
diff --git a/src/main/resources/icons/severity/M.svg b/src/main/resources/icons/severity/M.svg
new file mode 100644
index 0000000..548f79a
--- /dev/null
+++ b/src/main/resources/icons/severity/M.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/main/resources/messages/CycodeBundle.properties b/src/main/resources/messages/CycodeBundle.properties
index 03f915b..014f879 100755
--- a/src/main/resources/messages/CycodeBundle.properties
+++ b/src/main/resources/messages/CycodeBundle.properties
@@ -85,3 +85,13 @@ runOption=Run
rescanOption=Rescan
openInEditorOption=Open in Editor
openViolationCardOption=Open Violation Card
+# sca violation card
+scaViolationCardShortSummary={0} | {1}
+scaViolationCardHeaderPackageField=Package:
+scaViolationCardHeaderVersionField=Version:
+scaViolationCardHeaderPatchedVersionField=First patched version:
+scaViolationCardHeaderPatchedVersionDefaultValue=Not fixed
+scaViolationCardHeaderDependencyPathField=Dependency path:
+scaViolationCardHeaderLicenseField=License:
+scaViolationCardHeaderLicenseDefaultValue=Unknown
+scaViolationCardSummaryTitle=Summary
\ No newline at end of file