From 047bc2e9e1c2ef6eed1c04806c2cba8e08bb1c3e Mon Sep 17 00:00:00 2001
From: Joel von der Weid <joel.von-der-weid@hesge.ch>
Date: Wed, 3 Jul 2024 13:26:51 +0200
Subject: [PATCH] Fix sonar success bug

---
 helpers/Dojo/AssignmentValidator.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/helpers/Dojo/AssignmentValidator.ts b/helpers/Dojo/AssignmentValidator.ts
index f9604ab..c70e3cd 100644
--- a/helpers/Dojo/AssignmentValidator.ts
+++ b/helpers/Dojo/AssignmentValidator.ts
@@ -300,7 +300,7 @@ class AssignmentValidator {
                 this.newSubStep('SONAR_RUN', 'Run sonar analysis');
 
                 const runSuccess = SonarAnalyzer.runAnalysis(assignment.sonarKey, assignment.language, assignmentFile.buildLine);
-                if ( runSuccess ) {
+                if ( !runSuccess ) {
                     if ( !assignment.allowSonarFailure ) {
                         this.emitError(`Sonar gate failed`, 'Sonar analysis failure', AssignmentCheckerError.SONAR_ANALYSIS_FAILED);
                         return;
-- 
GitLab