Skip to content

Commit

Permalink
Mise en place de l'analyse SonarQube en local pour le frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Micheeeeel committed Oct 24, 2023
1 parent c59b182 commit d946c04
Show file tree
Hide file tree
Showing 6 changed files with 211 additions and 1 deletion.
Empty file added front/.scannerwork/.sonar_lock
Empty file.
Binary file not shown.
6 changes: 6 additions & 0 deletions front/.scannerwork/report-task.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
projectKey=bobapp
serverUrl=https://b28e-2a01-e0a-2d-a090-41d3-2457-aed5-3965.ngrok-free.app
serverVersion=10.2.1.78527
dashboardUrl=https://b28e-2a01-e0a-2d-a090-41d3-2457-aed5-3965.ngrok-free.app/dashboard?id=bobapp
ceTaskId=AYtg5lllaLpwacgQz9fM
ceTaskUrl=https://b28e-2a01-e0a-2d-a090-41d3-2457-aed5-3965.ngrok-free.app/api/ce/task?id=AYtg5lllaLpwacgQz9fM
188 changes: 188 additions & 0 deletions front/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"test": "ng test --watch=false --code-coverage",
"build:prod": "ng build --prod",
"lint": "ng lint",
"test:prod": "ng test --browsers=ChromeHeadless --watch=false --code-coverage"
"test:prod": "ng test --browsers=ChromeHeadless --watch=false --code-coverage",
"sonar": "node sonar-project.js"
},
"private": true,
"dependencies": {
Expand Down Expand Up @@ -39,6 +40,7 @@
"karma-jasmine": "5.1.0",
"karma-jasmine-html-reporter": "2.0.0",
"sonarqube": "^0.0.1",
"sonarqube-scanner": "^3.1.0",
"typescript": "4.8.2"
}
}
14 changes: 14 additions & 0 deletions front/sonar-project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const sonarqubeScanner = require("sonarqube-scanner");
sonarqubeScanner(
{
serverUrl: "http://localhost:9000",
token: "squ_a5177bdeab7985362d9985cd6354b2b75a81bd7d", // Ajoutez cette ligne
options: {
"sonar.sources": ".", // Indique que la racine du projet est le point de départ de l'analyse.
"sonar.inclusions": "src/**", // Spécifie que seuls les fichiers sous le répertoire packages/core/src/ doivent être inclus dans l'analyse.
"sonar.javascript.lcov.reportPaths":
"coverage/bobapp/report-lcovonly.txt",
},
},
() => {}
);

0 comments on commit d946c04

Please sign in to comment.