diff --git a/README.md b/README.md index 0ef240e..747e537 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Cycode IntelliJ Platform Plugin (beta) +# Cycode IntelliJ Platform Plugin 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 658018a..5ca912a 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 @@ -121,6 +121,13 @@ class TreeView( } } + private fun getDetectionSummary(sortedDetections: List): String { + // detections must be sorted by severity + return sortedDetections.groupBy { it.severity } + .map { (severity, detections) -> "$severity - ${detections.size}" } + .joinToString(" | ") + } + private fun createDetectionNodes( scanType: CliScanType, scanResults: ScanResultBase, @@ -129,13 +136,17 @@ class TreeView( val sortedDetections = scanResults.detections.sortedByDescending { getSeverityWeight(it.severity) } val detectionsByFile = sortedDetections.groupBy { it.detectionDetails.getFilepath() } + rootNodes.setNodeSummary(scanType, getDetectionSummary(sortedDetections)) + for ((filePath, detections) in detectionsByFile) { val fileName = File(filePath).name val summary = CycodeBundle.message("fileNodeSummary", detections.size) + val fileNode = createNode(FileNode(fileName, summary)) for (detection in detections) { fileNode.add(createNodeCallback(detection)) } + rootNodes.getScanTypeNode(scanType).add(fileNode) } } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index e213d29..39c842b 100755 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -11,10 +11,10 @@ - + displayName="Cycode"/> diff --git a/src/main/resources/messages/CycodeBundle.properties b/src/main/resources/messages/CycodeBundle.properties index 8ab1f32..932fcd4 100755 --- a/src/main/resources/messages/CycodeBundle.properties +++ b/src/main/resources/messages/CycodeBundle.properties @@ -25,7 +25,7 @@ scanFileResultNotification=Cycode has detected {0} {1} issues in your file. Chec scanFileNoResultNotification=No {0} issues were found. openProblemsTabAction=Open "Cycode" tab # tool window -toolWindowId=Cycode (beta) +toolWindowId=Cycode howToUseLabel=To learn more about how to use Cycode in the IDE by JetBrains, please visit our docs. # auth content tab authBtn=Authenticate @@ -56,12 +56,12 @@ settingsCliAppUrlLabel=APP URL: settingsCliAdditionalParamsLabel=Additional parameters: # scan types display names secretDisplayName=Hardcoded Secrets -scaDisplayName=Open Source Threat +scaDisplayName=Open Source Threat (beta) sastDisplayName=Code Security iacDisplayName=Infrastructure As Code # tree view nodes summaries fileNodeSummary={0} vulnerabilities secretNodeSummary= -scaNodeSummary=(beta) +scaNodeSummary= sastNodeSummary=(coming soon) iacNodeSummary=(coming soon)