So I took the debug logs from both runs, removed the timestamps and diffed the files, here’s some of the things I found:
186,187c187,189
< INFO: Load quality profiles (done) | time=129ms
---
> INFO: Load quality profiles (done) | time=86ms
> INFO: Auto-configuring with CI 'Jenkins'
Jenkins is detected, and “auto-configured” (not sure what exactly that means)
Here is the part in the Jenkins log* where the TS files are analysed and the issue is detected (“Saving issue for rule no-unnecessary-type-assertion on line 15”):
INFO: Found 1 tsconfig.json file(s): [/app/tsconfig.json]
DEBUG: /app/src/App.tsx matched /app/tsconfig.json
DEBUG: /app/src/main.tsx matched /app/tsconfig.json
INFO: Analyzing 2 files using tsconfig: /app/tsconfig.json
INFO: 2 source files to be analyzed
INFO: Load project repositories
DEBUG: GET 200 https://URL/batch/project.protobuf?key=sonarqube-redundant-non-null-assertions&branch=main | time=15ms
INFO: Load project repositories (done) | time=23ms
DEBUG: 'src/App.tsx' generated metadata with charset 'UTF-8'
DEBUG: Resolved 'react' as 'undefined'
DEBUG: ... 'react' was imported in '/app/src/App.tsx'
DEBUG: Saving issue for rule no-unnecessary-type-assertion on line 15
DEBUG: 'src/main.tsx' generated metadata with charset 'UTF-8'
DEBUG: Resolved 'react' as 'undefined'
DEBUG: ... 'react' was imported in '/app/src/main.tsx'
DEBUG: Resolved 'react-dom' as 'undefined'
DEBUG: ... 'react-dom' was imported in '/app/src/main.tsx'
DEBUG: Resolved './App' as '/app/src/App.tsx'
DEBUG: ... './App' was imported in '/app/src/main.tsx'
DEBUG: Not enough content in 'src/main.tsx' to have CPD blocks, it will not be part of the duplication detection
INFO: 2/2 source files have been analyzed
INFO: Sensor TypeScript analysis [javascript] (done) | time=7042ms
In the local log, this looks like this, with some kind of error, and no issue being detected:
INFO: Found 1 tsconfig.json file(s): [/app/tsconfig.json]
DEBUG: /app/src/App.tsx matched /app/tsconfig.json
DEBUG: /app/src/main.tsx matched /app/tsconfig.json
INFO: 2 source files to be analyzed
INFO: Analyzing 2 files using tsconfig: /app/tsconfig.json
INFO: Load project repositories
DEBUG: GET 200 https://URL/batch/project.protobuf?key=sonarqube-redundant-non-null-assertions&branch=main | time=28ms
INFO: Load project repositories (done) | time=36ms
DEBUG: 'src/App.tsx' generated metadata with charset 'UTF-8'
DEBUG: delta [ns] since modification FileSnapshot failed to detect
count, failures, racy limit [ns], delta min [ns], delta max [ns], delta avg [ns], delta stddev [ns]
20066, 521, 5000, 2513000.0, 6378000.0, 4463015.355086373, 1112940.7941585348
DEBUG: FileStoreAttributes[fsTimestampResolution=2 µs, minimalRacyInterval=6,378 µs]
DEBUG: loading config FileBasedConfig[/tmp/jgit/config]
DEBUG: Resolved 'react' as 'undefined'
DEBUG: ... 'react' was imported in '/app/src/App.tsx'
DEBUG: 'src/main.tsx' generated metadata with charset 'UTF-8'
DEBUG: Resolved 'react' as 'undefined'
DEBUG: ... 'react' was imported in '/app/src/main.tsx'
DEBUG: Resolved 'react-dom' as 'undefined'
DEBUG: ... 'react-dom' was imported in '/app/src/main.tsx'
DEBUG: Resolved './App' as '/app/src/App.tsx'
DEBUG: ... './App' was imported in '/app/src/main.tsx'
DEBUG: Not enough content in 'src/main.tsx' to have CPD blocks, it will not be part of the duplication detection
INFO: 2/2 source files have been analyzed
*In the Jenkins logs I replaced the path to the original workspace with /app
to get better diffs