Skip to content

Conversation

@rgetz
Copy link

@rgetz rgetz commented Nov 27, 2025

Motivation:
Cppcheck-htmlreport previously generated local annotated HTML for all source files. For private or large repositories, generating local HTML is unnecessary and cumbersome. It consumes additional disk space, increases report generation time, and duplicates functionality already provided by GitHub/GitLab browseable HTML pages. This patch allows the cppcheck report itself to be public, while the actual source code remains protected on GitHub/GitLab using their standard access controls.

Changes:

  • Detect --source-dir URLs pointing to GitHub/GitLab.
  • Use remote URLs in index.html instead of generating local HTML for those files.
  • Line numbers link directly to GitHub/GitLab with proper anchors (#L123).
  • Remote links open in a new tab (target="_blank"), preserving local HTML behavior for normal files.

@danmar
Copy link
Owner

danmar commented Nov 29, 2025

sounds good. there is a ci failure.

Motivation:
Cppcheck-htmlreport previously generated local annotated HTML for all source files.
For private or large repositories, generating local HTML is unnecessary and cumbersome.
It consumes additional disk space, increases report generation time, and duplicates
functionality already provided by GitHub/GitLab browseable HTML pages.
This patch allows the cppcheck report itself to be public, while the actual source code
remains protected on GitHub/GitLab using their standard access controls.

Changes:
- Detect --source-dir URLs pointing to GitHub/GitLab.
- Use remote URLs in index.html instead of generating local HTML for those files.
- Line numbers link directly to GitHub/GitLab with proper anchors (#L123).
- Remote links open in a new tab (target="_blank"), preserving local HTML behavior for normal files.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
@rgetz
Copy link
Author

rgetz commented Nov 30, 2025

sorry - should have ran that locally before submitting. My bad.

pylint ./htmlreport/cppcheck-htmlreport
------------------------------------
Your code has been rated at 10.00/10

Alternative (more complicated) implementation would extract github url/branch from command line tools - but I thought this would be more fragile, and not lend itself to other url implementations (gitlab)...

And I'm also assuming you want some doc updates? (Where/all?)

  • gui/help/manual.html
  • htmlreport/README.txt
  • man/manual.md
  • man/manual-ja.docbook (My Japanese is limited to google translate - so I don't think this is a good idea for me)
  • man/manual-premium.md

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 1, 2025

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