Skip to content

Promote AA0471, AA0472 and AA0474 to Error in the base ruleset - #10209

Merged
Jesper Schulz-Wedde (JesperSchulz) merged 3 commits into
mainfrom
jesperschulz-ruleset-hardening-3
Aug 14, 2026
Merged

Promote AA0471, AA0472 and AA0474 to Error in the base ruleset#10209
Jesper Schulz-Wedde (JesperSchulz) merged 3 commits into
mainfrom
jesperschulz-ruleset-hardening-3

Conversation

@JesperSchulz

@JesperSchulz Jesper Schulz-Wedde (JesperSchulz) commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Continues the ruleset hardening for AB#640773 by promoting three analyzer rules from None back to Error in src/rulesets/base.ruleset.json.

Stacked on #10133.

What changed

Rule Distinct violations How it is handled
AA0472 0 Override removed
AA0471 1 Fixed in code, override removed
AA0474 5 Fixed in code, override removed

All six violations are in the Withholding Tax app, and all are genuine omissions rather than exceptions worth accepting, so they are fixed rather than suppressed.

AutoFormatType = 1 means the value is an amount, and the analyzer requires a matching AutoFormatExpression naming the currency. In Withholding Tax Entry and WHT Empl. Ledger Entry Ext the neighbouring amount fields already specify AutoFormatExpression = Rec."Currency Code", and the fields flagged here had simply been missed, so they now do the same. WHT Threshold Accumulator has no currency field at all because it only ever accumulates local currency amounts, so it uses an empty expression, which is the standard way to express LCY.

Fixing the table field also resolved the AA0471 report on Withholding Tax Entries, since the page control inherits its formatting from the underlying field.

Corrected scope

The first revision of this PR also promoted AA0473 and AS0112, on the strength of local measurements that found 4 and 3 violations respectively. CI disagreed, and CI was right: 886 AA0473 and 630 AS0112 diagnostics across the 44 Build Apps jobs.

The local scan had simply not reached far enough. It had covered 398 of 878 projects when it was stopped, and the dependency-ordered pass before it could not build large parts of src/Apps at all, so entire areas — Master Data Mgt., BC14 Historical Data, remittance advice and others — were never examined. A rule looked clean because nothing had looked at the code that violates it.

Both rules therefore keep their overrides and need real remediation in their own PRs.

How the surviving numbers were established

From the failed CI run itself, which compiles everything. Tallying ##[error] diagnostics across all 44 Build Apps jobs gives AA0471 36 and AA0474 180 occurrences, but those are the same handful of W1 sites recompiled once per country: 1 and 5 distinct sites. AA0472 does not appear in any job.

The six sites were then reproduced locally against the updated ruleset to get exact line numbers, and the Withholding Tax app now compiles clean (exit 0) with CodeCop, AppSourceCop, PerTenantExtensionCop and UICop enabled.

Related to AB#640773

Jesper Schulz-Wedde and others added 2 commits August 12, 2026 11:20
AD0001 and AL0640 are overridden to Error in base.ruleset.json, which is
already the effective severity: base.ruleset.json sets generalAction to
Error, and neither rule is downgraded by the included ruleset.json.

Removing the two entries is therefore a no-op for analysis behaviour and
simply reduces the override list from 105 to 103.

Related to AB#640773

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7e6fd312-fe92-4215-8333-f98ba0a2e25d
AA0471, AA0472 and AA0474 have no violations anywhere in the repository, so
their overrides are removed outright.

AA0473 and AS0112 each have a handful of violations. Rather than keeping the
rules disabled for the whole repository, the individual sites are marked with
#pragma warning disable so they become accepted violations, and the overrides
are removed as well.

Related to AB#640773

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7e6fd312-fe92-4215-8333-f98ba0a2e25d
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 Other GitHub request for other area than SCM, Finance or Integration Ownership: Needs Review Ownership is Other, low confidence, or needs manual correction labels Aug 12, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Aug 12, 2026
CI showed that the earlier scope was based on incomplete local coverage:
AA0473 and AS0112 have several hundred violations across the repository, so
their overrides are restored and they are left for dedicated remediation.

AA0471 and AA0474 turned out to have only six sites in total, all in the
Withholding Tax app, and all of them are genuine omissions rather than
acceptable exceptions. They are fixed by supplying the missing
AutoFormatExpression, matching what neighbouring fields in the same tables
already do. The accumulator table has no currency, so it formats in local
currency.

Related to AB#640773

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7e6fd312-fe92-4215-8333-f98ba0a2e25d
@JesperSchulz Jesper Schulz-Wedde (JesperSchulz) changed the title Promote five analyzer rules to Error in the base ruleset Promote AA0471, AA0472 and AA0474 to Error in the base ruleset Aug 13, 2026
Merged via the queue into main with commit c451f37 Aug 14, 2026
339 of 351 checks passed
@JesperSchulz
Jesper Schulz-Wedde (JesperSchulz) deleted the jesperschulz-ruleset-hardening-3 branch August 14, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Other GitHub request for other area than SCM, Finance or Integration Ownership: Needs Review Ownership is Other, low confidence, or needs manual correction

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants