java.lang.NumberFormatException: For input string: "{{tabIndex}}"

We use the sonarcloud API to inspect our typescript code/angular application.
ScannerMode is defined as “CLI”.
Using config file with definition for organization, projectkey, …
The configuration file contains the URL “https://sonarcloud.io”.

HTML- Code that has issues:

.....
<button tabindex="{{tabindex}}">
....

Error message during pipeline build:
09:05:40.873 INFO Load metrics repository
09:05:40.918 INFO Load metrics repository (done) | time=43ms
09:05:40.928 INFO Sensor cache enabled
09:05:42.227 INFO Load sensor cache
09:05:42.643 INFO Load sensor cache (404) | time=418ms
09:05:43.507 INFO Sensor HTML [web]
##[error]09:05:44.424 ERROR Cannot analyze file src/app/components/basic/button/button-base/button-base.component.html
java.lang.NumberFormatException: For input string: “{{tabIndex}}”
at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.base/jdk.internal.math.FloatingDecimal.parseDouble(Unknown Source)
at java.base/java.lang.Double.parseDouble(Unknown Source)
at org.sonar.plugins.html.api.accessibility.AccessibilityUtils.isFocusableElement(AccessibilityUtils.java:52)
at org.sonar.plugins.html.checks.accessibility.NoAriaHiddenOnFocusableCheck.startElement(NoAriaHiddenOnFocusableCheck.java:38)
at org.sonar.plugins.html.visitor.HtmlAstScanner.scanElementTag(HtmlAstScanner.java:109)
at org.sonar.plugins.html.visitor.HtmlAstScanner.scanElement(HtmlAstScanner.java:88)

Hey there!

Thanks for the report. We’re aware of the issue and there’s an open ticket to fix it. SONARHTML-250

I’ll link your thread to that ticket. In the meantime, you might be able to just exclude this file or all JSP files if it’s crashing your analysis.

Thank you for your quick response and your proposal.

1 Like