Skip to content

Commit

Permalink
fix: unnecessary variable
Browse files Browse the repository at this point in the history
  • Loading branch information
cat2608 committed Mar 21, 2024
1 parent 555307f commit e280404
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/main/kotlin/io/snyk/plugin/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,6 @@ fun isFileListenerEnabled(): Boolean = pluginSettings().fileListenerEnabled

fun isSnykCodeLSEnabled(): Boolean = Registry.`is`("snyk.preview.snyk.code.ls.enabled", true)

fun isFeatureFlagEnabled(): Boolean = isSnykCodeLSEnabled() && pluginSettings().isGlobalIgnoresFeatureEnabled

fun getWaitForResultsTimeout(): Long =
Registry.intValue(
"snyk.timeout.results.waiting",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import io.snyk.plugin.getSnykAnalyticsService
import io.snyk.plugin.getSnykProjectSettingsService
import io.snyk.plugin.getSnykToolWindowPanel
import io.snyk.plugin.getSyncPublisher
import io.snyk.plugin.isFeatureFlagEnabled
import io.snyk.plugin.isProjectSettingsAvailable
import io.snyk.plugin.isSnykCodeLSEnabled
import io.snyk.plugin.isUrlValid
Expand Down
3 changes: 1 addition & 2 deletions src/main/kotlin/io/snyk/plugin/ui/SnykSettingsDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import io.snyk.plugin.events.SnykCliDownloadListener
import io.snyk.plugin.getCliFile
import io.snyk.plugin.getSnykCliAuthenticationService
import io.snyk.plugin.getSnykCliDownloaderService
import io.snyk.plugin.isFeatureFlagEnabled
import io.snyk.plugin.isProjectSettingsAvailable
import io.snyk.plugin.isSnykCodeLSEnabled
import io.snyk.plugin.isUrlValid
Expand Down Expand Up @@ -279,7 +278,7 @@ class SnykSettingsDialog(

/** Products and Severities selection ------------------ */

if (isFeatureFlagEnabled()) {
if (pluginSettings().isGlobalIgnoresFeatureEnabled) {
val issueViewPanel = JPanel(UIGridLayoutManager(3, 2, Insets(0, 0, 0, 0), 30, -1))
issueViewPanel.border = IdeBorderFactory.createTitledBorder("Issue view options")

Expand Down
3 changes: 1 addition & 2 deletions src/main/kotlin/snyk/common/lsp/SnykLanguageClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import com.intellij.openapi.util.io.toNioPathOrNull
import io.snyk.plugin.events.SnykCodeScanListenerLS
import io.snyk.plugin.getContentRootVirtualFiles
import io.snyk.plugin.getSyncPublisher
import io.snyk.plugin.isFeatureFlagEnabled
import io.snyk.plugin.isSnykCodeLSEnabled
import io.snyk.plugin.pluginSettings
import io.snyk.plugin.snykcode.core.SnykCodeFile
Expand Down Expand Up @@ -178,7 +177,7 @@ class SnykLanguageClient : LanguageClient {
val includeIgnoredIssues = pluginSettings.ignoredIssuesEnabled
val includeOpenedIssues = pluginSettings.openIssuesEnabled

val processedIssues = if (isFeatureFlagEnabled()) {
val processedIssues = if (pluginSettings.isGlobalIgnoresFeatureEnabled) { //
snykScan.issues.filter { it.isVisible(includeOpenedIssues, includeIgnoredIssues) }
} else {
snykScan.issues
Expand Down

0 comments on commit e280404

Please sign in to comment.