Hi everybody,
I’m working on simple CRUD application for educational purposes, more precisely university project. One of many topics is scanning code with SonarQube.
What am I using:
- sonarqube Docker image, tag
latest
- NestJS, version 10.0.0
- Primsa ORM with Postgres, Prisma version 5.15.0
- typescript, version: 5.1.3
Other maybe relevant things:
- Node v21.6.0
- yarn package manager
- win 11 x64
Since topic is secure codding, I’ve tried to test sonar, and I’ve tried to trigger security check for SQL injection that i have in code, but it’s not detected, and that part is marked with uncovered code.
Command for running analysis:
sonar-scanner.bat -D"sonar.projectKey=tanks-api" -D"sonar.sources=." -D"sonar.javascript.lcov.reportPaths=../coverage/lcov.info" -D"sonar.inclusions=src/**/*.ts" -D"sonar.host.url=http://localhost:9000" -D"sonar.token={my-token}"
Code in service.ts where SQL injection is:
Some basic are detected like commented code, API secretes like hardcoded api-keys, unused imported functions. But any NestJs code or Prisma code is not covered by sonar.
Also since I’m using WebStorm I’ve installed SonarLint, having same results.
For any additional info fell free to ping me.
I have scraped google searching for solution but i can’t find any so i think this is my only option left.