From 478d4ab92ce9f4659dbcaf58c8be93a16e820fd3 Mon Sep 17 00:00:00 2001 From: carlospelazas Date: Mon, 6 May 2024 15:59:40 +0200 Subject: [PATCH] fix quality gate --- game/groupservice/GroupController.js | 2 +- game/qgservice/QGController.js | 2 +- game/qgservice/generatorLogic/MathQuestions.js | 4 ++-- sonar-project.properties | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/game/groupservice/GroupController.js b/game/groupservice/GroupController.js index ec9ee71..e2e93e0 100644 --- a/game/groupservice/GroupController.js +++ b/game/groupservice/GroupController.js @@ -136,7 +136,7 @@ let GroupController = { async function getGroupByName(name) { try { - const group = await Group.findOne({ groupName: name }); + const group = await Group.findOne({ groupName: name.toString() }); if (!group) { throw new Error('This group does not exist'); } diff --git a/game/qgservice/QGController.js b/game/qgservice/QGController.js index 85d4c7c..e40e004 100644 --- a/game/qgservice/QGController.js +++ b/game/qgservice/QGController.js @@ -79,7 +79,7 @@ let QGController = { const { ids } = req.body; const questions = []; for (const id of ids) { - const question = await Question4Answers.find({uuid: id}) + const question = await Question4Answers.find({uuid: id.toString()}) questions.push(question); } res.json(questions); diff --git a/game/qgservice/generatorLogic/MathQuestions.js b/game/qgservice/generatorLogic/MathQuestions.js index facb674..0127575 100644 --- a/game/qgservice/generatorLogic/MathQuestions.js +++ b/game/qgservice/generatorLogic/MathQuestions.js @@ -37,11 +37,11 @@ function generateRandomMathQuestion() { }; } - async function createMathQuestions(numberOfQuestions, lang) { + async function createMathQuestions(numberOfQuestions) { const questions = []; for (let i = 0; i < numberOfQuestions; i++) { - const mathQuestion = generateRandomMathQuestion(lang); + const mathQuestion = generateRandomMathQuestion(); questions.push(mathQuestion); } diff --git a/sonar-project.properties b/sonar-project.properties index da5ec60..96039e0 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,7 +11,7 @@ sonar.language=js sonar.projectName=wiq_en2a sonar.coverage.exclusions=**/*.test.js -sonar.sources=webapp/src/components,users/authservice,users/userservice,gatewayservice,game/gameservice,game/groupservice,game/qgservice,multiplayerservice +sonar.sources=webapp/src/components,users/authservice,users/userservice,gatewayservice,game/gameservice,game/groupservice,game/qgservice sonar.sourceEncoding=UTF-8 sonar.exclusions=node_modules/** sonar.javascript.lcov.reportPaths=**/coverage/lcov.info \ No newline at end of file