Skip to content

Fix #14689 (html report: Fix missing severity and classification bars)#8456

Open
vkucera wants to merge 1 commit intocppcheck-opensource:mainfrom
vkucera:severity-bar
Open

Fix #14689 (html report: Fix missing severity and classification bars)#8456
vkucera wants to merge 1 commit intocppcheck-opensource:mainfrom
vkucera:severity-bar

Conversation

@vkucera
Copy link
Copy Markdown
Contributor

@vkucera vkucera commented Apr 16, 2026

Fixes a bug introduced in #7994.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Collaborator

@danmar danmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@vkucera
Copy link
Copy Markdown
Contributor Author

vkucera commented Apr 25, 2026

lgtm

Thanks for the review. Is there anything left before it can be merged?

@danmar danmar changed the title Fix missing severity and classification bars in the HTML report Fix #14689 (html report: Fix missing severity and classification bars) Apr 25, 2026
@danmar
Copy link
Copy Markdown
Collaborator

danmar commented Apr 25, 2026

does this suggestion below make sense? I asked claude about how to test this..

filter_bar() is called during full report generation. Since example.xml already contains severity="error" and severity="style", an integration test can assert that the severity bar
checkboxes actually appear in index.html. Before the fix, the entire severity bar was silently cleared to '', so toggleSeverity never appeared in the output.

Add one test method to test_htmlreport.py:

  def testSeverityFilterBar(self):                                                                                                                                                           
      """Regression test for #14689: severity bar must appear when errors exist."""
      with runCheck(xml_filename=os.path.join(TEST_TOOLS_DIR, 'example.xml')) as (report, output_directory):                                                                                 
          # example.xml contains error and style severities, so the                                                                                                                          
          # severity filter bar must be present. Before the fix in #7994,                                                                                                                    
          # filter_bar() checked for "checked/>" (XHTML) but filter_button()                                                                                                                 
          # emits "checked>" (HTML5), so the bar was always cleared to ''.                                                                                                                   
          self.assertIn('toggleSeverity', report)                                                                                                                                            
          output_directory.cleanup()                                                                                                                                                         

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants