We use bitbucket pipelines to build and deploy our angular project and are using the sonarcloud-scan. We see that our html and css files are validated for code smells and bugs, but no code smells and bugs are shown on our *ts files. We are sure that violations on ts files are there. It seems that our ts files are not scanned.
definitions:
steps:
- step: &test
name: Test application
image: atlassianlabs/docker-node-jdk-chrome-firefox
size: 2x
script:
- npm cache clean -f
- npm install -g n
- n 12.16.3
- npm install -g @angular/cli@9.1.1
- npm install
- ng test --watch=false --browsers=ChromeHeadless --code-coverage=true
artifacts:
- coverage/sml-customer-web/**
- step: &sonar-cloud-scan
name: Sonar Cloud Scan
script:
- pipe: sonarsource/sonarcloud-scan:1.4.0
variables:
EXTRA_ARGS: -Dsonar.projectKey=$SONAR_PROJECT_KEY-${BITBUCKET_BRANCH} -Dsonar.projectName=$SONAR_PROJECT_KEY-${BITBUCKET_BRANCH} -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_TOKEN -Dproject.settings=./sonar.properties
SONAR_SCANNER_OPTS: -Xmx512m
DEBUG : "true"
branches:
develop:
- step: *test
- step: *sonar-cloud-scan
Our sonar properties
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.exclusions=**/node_modules/**,**/src/environments/**
sonar.coverage.exclusions=src/environments/**/*
sonar.tests=src
sonar.test.inclusions=**/*.spec.ts
sonar.javascript.lcov.reportPaths=coverage/sml-customer-web/lcov.info
sonar.scm.provider=git
sonar.typescript.tsconfigPath=./tsconfig.json