File tree 3 files changed +18
-1
lines changed
src/main/kotlin/com/cycode/plugin
3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 4
4
5
5
## [ Unreleased]
6
6
7
+ - Fix empty IaC scan results on Windows
8
+
7
9
## [ 2.0.0] - 2024-08-20
8
10
9
11
- Add support for IDEs 2024.2
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import com.cycode.plugin.cli.models.scanResult.secret.SecretScanResult
14
14
import com.cycode.plugin.components.toolWindow.updateToolWindowState
15
15
import com.cycode.plugin.sentry.SentryInit
16
16
import com.cycode.plugin.utils.CycodeNotifier
17
+ import com.cycode.plugin.utils.isValidExistedFilePath
17
18
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer
18
19
import com.intellij.openapi.components.Service
19
20
import com.intellij.openapi.diagnostic.thisLogger
@@ -268,7 +269,7 @@ class CliService(private val project: Project) {
268
269
// TF plans are virtual files what is not exist in the file system
269
270
// "file_name": "1711298252-/Users/ilyasiamionau/projects/cycode/ilya-siamionau-payloads/tfplan.tf",
270
271
// skip such detections
271
- return @filter filePath.startsWith( " / " )
272
+ return @filter isValidExistedFilePath(filePath )
272
273
}
273
274
}
274
275
Original file line number Diff line number Diff line change
1
+ package com.cycode.plugin.utils
2
+
3
+ import java.io.File
4
+ import java.io.IOException
5
+
6
+ fun isValidExistedFilePath (path : String ): Boolean {
7
+ val file = File (path)
8
+ return try {
9
+ file.canonicalPath
10
+ file.exists()
11
+ } catch (e: IOException ) {
12
+ false
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments