My issue is the in the HTML pages produced by cppcheck-htmlreport, the scripts to filter the issues are broken.
I was using cppcheck 2.2 and I thought it was because the version was too old, but now that I've update to cppcheck 2.7 I see the issue is the same.
The problem is reported by Firefox and Chrome in the same way:
index.html:54 Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': '.misra-c2012-11.4' is not a valid selector.
As you can see, I am using the MISRA plugin and the error tags contain a dot. When htmlreport produces its output, it uses this tag as CSS classes and it is illegal to use a dot there. As such, the javascript doesn't succeed to select properly the issues to filter.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I used the following as a makeshift solution on the html output for the MISRA C rules:
sed -i 's/misra-c2012-\([[:digit:]]\+\)./misra-c2012-\1_/g' your_html_folder_name/*
It will replace e. g. 'misra-c2012-8.9' with 'misra-c2012-8_9'. In fact, the '9' in this case will not even be touched. Just the point before.
But, there is definitely a fix needed for this. I think there could be other characters that will produce the same error. I encountered it with colon (:), too.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My issue is the in the HTML pages produced by cppcheck-htmlreport, the scripts to filter the issues are broken.
I was using cppcheck 2.2 and I thought it was because the version was too old, but now that I've update to cppcheck 2.7 I see the issue is the same.
The problem is reported by Firefox and Chrome in the same way:
index.html:54 Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': '.misra-c2012-11.4' is not a valid selector.
As you can see, I am using the MISRA plugin and the error tags contain a dot. When htmlreport produces its output, it uses this tag as CSS classes and it is illegal to use a dot there. As such, the javascript doesn't succeed to select properly the issues to filter.
I can confirm.
I used the following as a makeshift solution on the html output for the MISRA C rules:
It will replace e. g. 'misra-c2012-8.9' with 'misra-c2012-8_9'. In fact, the '9' in this case will not even be touched. Just the point before.
But, there is definitely a fix needed for this. I think there could be other characters that will produce the same error. I encountered it with colon (:), too.