ikamel92
(Ikamel92)
April 26, 2024, 6:09am
1
Hi,
I’m currently facing a strange behavior in Sonar for Angular Project . This and few other similar errors are thrown in component templates:
java.lang.NumberFormatException: For input string: "{{index}}"
we are using Azure DevOps Pipelines, and we Have 2 tasks:
SonarCloudPrepare
SonarCloudAnalyze
In SonarCloudPrepare we are configuring sonar settings with the following:
sonar.sourceEncoding=utf-8
sonar.typescript.tsconfigPath = tsconfig.app.json
sonar.exclusions=**/*.svg,**/*.png,**/*.ico,**/*.css,**/*.spec.ts,**/*.js,**/node_modules/**,**/e2e/**,**/coverage/**,**/*.ttf
sonar.coverageReportPaths=$(Agent.TempDirectory)/mergedcoveragereport/SonarQube.xml
sonar.log.level=DEBUG
sonar.verbose=true
set SONAR_SCANNER_OPTS="-Xmx8G"
Any clue what the above error indicates and how to solve it?
TIA…
Colin
(Colin)
April 26, 2024, 6:44am
2
Hey there.
Can you provide the full logs from the task throwing that error?
ikamel92
(Ikamel92)
April 26, 2024, 6:57am
3
Hi Colin, thanks for the quick reply. here is the log output from SonarCloudAnalyze task.
sonar-logs.txt (2.3 MB)
Colin
(Colin)
April 26, 2024, 7:05am
4
Thanks!
Could you share any one of the files where this error is throwing?
Such as this one:
src/shared/components/general-toolbar-dropdown-user/general-toolbar-dropdown-user.component.html
It looks like a problem in our HTML analyzer. With a file that reproduces the issue, I can pass it onto the right team.
ikamel92
(Ikamel92)
April 26, 2024, 7:42am
5
Hi Colin, please find the attached file.
filters-dropdown.zip (4.3 KB)
Thanks…
@ikamel92 , welcome to the community and thanks a lot for your valuable report and the code samples. Thanks to them, we were able to confirm and identify the issue. We created an internal ticket to have it fixed as soon as possible.
You can track its progress there .