Skip to content

Commit 8ed39dd

Browse files
fix(amazonq): fixing detekt errors
1 parent 5d2c6f5 commit 8ed39dd

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/BrowserConnector.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,8 @@ class BrowserConnector(
657657
for (aggregatedIssueUnformatted in jsonFindings) {
658658
val aggregatedIssue = gson.fromJson(gson.toJson(aggregatedIssueUnformatted), AggregatedCodeScanIssue::class.java)
659659
val file = LocalFileSystem.getInstance().findFileByIoFile(
660-
Path.of(aggregatedIssue.filePath).toFile())
660+
Path.of(aggregatedIssue.filePath).toFile()
661+
)
661662
if (file?.isDirectory == false) {
662663
scannedFiles.add(file)
663664
runReadAction {
@@ -694,14 +695,18 @@ class BrowserConnector(
694695
autoDetected = issue.autoDetected,
695696
scanJobId = issue.scanJobId,
696697
),
697-
698-
)
698+
)
699699
}
700700
}
701701
}
702702
}
703703

704-
CodeWhispererCodeScanManager.getInstance(project).addOnDemandIssues(mappedFindings, scannedFiles, CodeWhispererConstants.CodeAnalysisScope.AGENTIC)
704+
CodeWhispererCodeScanManager.getInstance(project)
705+
.addOnDemandIssues(
706+
mappedFindings,
707+
scannedFiles,
708+
CodeWhispererConstants.CodeAnalysisScope.AGENTIC
709+
)
705710
CodeWhispererCodeScanManager.getInstance(project).showCodeScanUI()
706711
}
707712
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/commands/codescan/actions/HandleIssueCommandAction.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class HandleIssueCommandAction : AnAction(), DumbAware {
2828
fun createLineRangeText(issueContext: MutableMap<String, String>): String {
2929
val startLineString = issueContext["startLine"]
3030
val endLineString = issueContext["endLine"]
31-
val startLineInteger = stringToInt(startLineString!!)
32-
val endLineInteger = stringToInt(endLineString!!)
31+
val startLineInteger = stringToInt(startLineString ?: return "")
32+
val endLineInteger = stringToInt(endLineString ?: return "")
3333
return if (startLineInteger == endLineInteger) {
3434
"[$startLineInteger]"
3535
} else {

0 commit comments

Comments
 (0)