Skip to content

Comments

Change: move total counting out of print_report_xml_start#2693

Merged
greenbonebot merged 11 commits intomainfrom
smaller-print-report-8
Jan 12, 2026
Merged

Change: move total counting out of print_report_xml_start#2693
greenbonebot merged 11 commits intomainfrom
smaller-print-report-8

Conversation

@mattmundell
Copy link
Contributor

@mattmundell mattmundell commented Dec 23, 2025

What

Move the counting of the result totals out of print_report_xml_start.

This PR starts by moving some key variables in print_report_xml_start into the ctx struct. Then it moves the block that does result counting out to a new function print_report_get_totals. Moving the variables allows print_report_get_totals to take a single arg. The function also uses that single arg to pass the counts back to the caller.

Note that, as with previous PRs, the variables moved into the struct print_report_context are automatically initialized to zero, due to the init of the struct: print_report_context_t ctx = {0};.

Why

Another small step in reducing the size of print_report_xml_start, so that it's easier to understand and maintain.

References

Follows /pull/2669

Testing

I got a single report with the PR, then got the same report on the main branch. I made sure they were the same. I did that with two timezones just to be sure (using the timezone term in the filter).

o m m '<get_reports report_id="92a09ffd-a5bd-464b-9f2c-54b78ec5ebcf" details="1" filter="timezone=Pacific/Auckland rows=3 apply_overrides=1 min_qod=60"/>' > /tmp/r-auk-main
o m m '<get_reports report_id="92a09ffd-a5bd-464b-9f2c-54b78ec5ebcf" details="1" filter="timezone=Europe/Berlin rows=3 apply_overrides=1 min_qod=60"/>' > /tmp/r-ber-main
diff /tmp/r-auk /tmp/r-auk-main
diff /tmp/r-ber /tmp/r-ber-main

@mattmundell mattmundell requested review from a team as code owners December 23, 2025 09:49
@greenbonebot greenbonebot enabled auto-merge (rebase) December 23, 2025 09:49
@greenbonebot greenbonebot merged commit 1f7b09a into main Jan 12, 2026
29 of 30 checks passed
@greenbonebot greenbonebot deleted the smaller-print-report-8 branch January 12, 2026 09:13
@mattmundell
Copy link
Contributor Author

@a-h-abdelsalam Thank you!

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.

3 participants