From 9503336354875dff7a0a27ba977de52457609b10 Mon Sep 17 00:00:00 2001 From: theshadowco Date: Sat, 13 Jan 2024 05:48:42 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=B4=D1=8B=D0=BC=D0=BE=D0=B2=D0=BE=D0=B9=20=D1=82=D0=B5=D1=81?= =?UTF-8?q?=D1=82=20=D0=B4=D0=BB=D1=8F=20extraMinForComplexity=20>=3D=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../diagnostics/metadata/DiagnosticInfo.java | 5 +---- .../bsl/languageserver/diagnostics/SmokyTest.java | 9 +++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/metadata/DiagnosticInfo.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/metadata/DiagnosticInfo.java index 9bf390db885..85b36f0d3f5 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/metadata/DiagnosticInfo.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/metadata/DiagnosticInfo.java @@ -199,10 +199,7 @@ public boolean canLocateOnProject() { } public double getExtraMinForComplexity() { - if (diagnosticMetadata.extraMinForComplexity() > 0) { - return diagnosticMetadata.extraMinForComplexity(); - } - return 0; + return diagnosticMetadata.extraMinForComplexity(); } public Map getDefaultConfiguration() { diff --git a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/SmokyTest.java b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/SmokyTest.java index a60b36b3fe2..f2c792b75a6 100644 --- a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/SmokyTest.java +++ b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/SmokyTest.java @@ -143,4 +143,13 @@ void testIAllDiagnostics() { assertThat(diagnosticErrors).isEmpty(); } + @Test + void testExtraMinForComplexity() { + // нельзя ставить отрицательное значение + diagnosticInfos.forEach(diagnosticInfo -> + assertThat(diagnosticInfo.getExtraMinForComplexity()) + .as(diagnosticInfo.getCode().getStringValue()) + .isNotNegative() + ); + } }