Repository navigation
Bug: efc-dead-code-and-latent-nre-traps #466
Description
- Work Mode: full-bug
Summary
EfcViewer.SetController is never called, so EfcViewer._formController is permanently null and
EditFiltersMenuItem_Click carries a latent NullReferenceException that a routine Designer
regeneration would arm. Several other EFC members and one orphaned file are dead code.
Environment
- OS/version: Windows 11 Pro 10.0.26200
- Runtime: .NET Framework 4.8.1 WinForms VSTO add-in
- UI path:
QuickFiler/Viewers/EfcViewer.cs,QuickFiler/Controllers/EfcItemController.cs - Data source or fixture: n/a
Steps to Reproduce
The trap is currently unreachable by design; it is armed by a maintenance action:
- Open
EfcViewerin the Visual Studio Designer and re-generateEfcViewer.Designer.cs, or otherwise
wireEditFiltersMenuItem.ClicktoEfcViewer.EditFiltersMenuItem_Click. - Open the Email Filer viewer and choose the Edit Filters menu item.
- Observe
NullReferenceException.
Expected Behavior
Either the controller is wired into the viewer so the Edit Filters command works, or the dead member
and its unreachable handler are removed so no trap remains.
Actual Behavior
A - dead SetController, permanently null field. EfcViewer.cs:50-53 declares
internal void SetController(EfcFormController controller). A repository-wide search for
SetController finds call sites only in QfcFormController.cs:44, QfcFormViewer.cs:46,
QfcFormViewerDark.cs:31, QfcFormViewerExpanded.cs:31, and the non-compiled Legacy/ and
EfcViewer3.cs files. EfcFormController never calls it, unlike its QFC twin. Consequently
EfcViewer._formController (EfcViewer.cs:48) is always null and
EfcViewer.EditFiltersMenuItem_Click (EfcViewer.cs:157-160) would throw.
The handler is currently unreachable: EfcViewer.Designer.cs never wires EditFiltersMenuItem.Click.
Verified - across 4,277 lines the only references are the declaration at :67, the DropDownItems
add at :4123, three property assignments at :4136-4138, and the field at :4275. There is no
+= at all. So this is dead code carrying a latent trap, not a live crash.
B - zero-call-site members in EfcItemController. InitializeWebView() (:174-205) and
RegisterActions(...) (:680-692) have no call sites repo-wide (verified by grep across QuickFiler/
and QuickFiler.Test/). _selectorsCtrls (:381) is initialized to null and never assigned before
being passed to SetupThemes as the selectors argument (:97, :144).
C - unused constructor overload. The EfcItemController
(globals, homeController, parent, itemViewer, dataModel, bool async, token) overload (:44-57) has
zero call sites; only the 6-argument (:30) and 5-argument (:59) forms are used, by
EfcFormController.cs:87 and :69.
D - orphaned uncompiled files. QuickFiler/Viewers/EfcViewer3.cs and its siblings are present in
the working tree but carry no <Compile Include> entry in QuickFiler/QuickFiler.csproj. EfcViewer3.cs
nonetheless carries an [ExcludeFromCodeCoverage] attribute at :17, which is misleading - an
uncompiled file needs no exemption.
Logs / Screenshots
- Attached minimal logs or screenshot
- Code-read evidence recorded above (verified 2026-08-07 against the working tree).
Impact / Severity
- Blocker
- High
- Medium
- Low
Nothing fails today. The severity is the maintenance trap: the Edit Filters command is silently
non-functional, and the natural act of re-wiring it in the Designer converts that into a crash.
Source
From: docs/features/potential/2026-08-07-efc-dead-code-and-latent-nre-traps.md
Activity
docs(quickfiler): prepare F9 EFC form/item controller coverage (#452)
Merge pull request #661 from drmoisan/bug/efc-controller-surface-defe…
drmoisan commentedon Aug 31, 2026
Closing as completed. Delivered under
efc-controller-surface-defects-464, across two commits —345f6848("remove dead EfcViewer surface and EfcViewer3 orphans (#466 A/D)") and5d567e7e("remove dead EfcItemController surface (#459, #464 D, #466 B/C)") — merged via PR #661 (merge commitee7d0ec4), both ancestors oforigin/main. The remedy for all four sub-defects was deletion of the dead code, rather than wiring it live.All four confirmed directly against
origin/main:SetController).EfcViewer.csno longer declaresSetControlleror the_formControllerfield;EditFiltersMenuItem_Clickis gone. (The live Edit Filters route throughEfcFormControlleris unaffected and unchanged.)EfcItemController.csno longer declaresRegisterActionsorInitializeWebView(zero occurrences of either); the async initializer that remains,InitializeWebViewAsync, has confirmed call sites.EfcItemControllernow declares exactly two constructors — the 6-argument and 5-argument forms — with no 7-parameter overload.QuickFiler/Viewers/EfcViewer3.csand its.Designer.cs/.resxsiblings are absent from the working tree.All corresponding acceptance criteria in
docs/features/active/efc-controller-surface-defects-464/spec.mdare checked[x], including the reflection-based tests pinning each removed member's absence.Verified during an admission check against the
bugs-638-644-647parallel run (2026-09-01). No branch or PR remains to ship; this was left open only as bookkeeping.