-
Notifications
You must be signed in to change notification settings - Fork 324
Description
Describe the issue
ISSUE: Generation Rule Management Has Unclear Separation from Traversal
Severity: HIGH
Category: Separation of Concerns
Files Affected:
-
app/src/Configuration/GenerationRule/QltyGenerationRuleMgmt.Codeunit.al(302 lines) -
app/src/Configuration/SourceConfiguration/QltyTraversal.Codeunit.al
Problem:
QltyGenerationRuleMgmt codeunit depends heavily on QltyTraversal codeunit, but the division of responsibilities is unclear:
codeunit 20405 "Qlty. Generation Rule Mgmt."
{
var
QltyMiscHelpers: Codeunit "Qlty. Misc Helpers";
QltyTraversal: Codeunit "Qlty. Traversal"; // Heavy dependency
internal procedure SetFilterToApplicableTemplates(...)
begin
// Calls QltyTraversal.FindPossibleTargetsBasedOnConfigRecursive()
CanLoopDoTargets := QltyTraversal.FindPossibleTargetsBasedOnConfigRecursive(...);
end;
procedure FindMatchingGenerationRule(...)
begin
// Calls QltyTraversal.FindPossibleTargetsBasedOnConfigRecursive()
if not QltyTraversal.FindPossibleTargetsBasedOnConfigRecursive(...) then
end;
}
Questions Raised:
-
Why is traversal separate from generation rule management?
-
Is traversal a reusable algorithm or specific to generation rules?
-
Should traversal be a local helper in GenerationRuleMgmt?
-
Or should GenerationRuleMgmt delegate more to Traversal?
Impact:
-
Unclear boundaries: Developers unsure which codeunit to modify
-
Dependency coupling: Cannot change traversal without affecting generation rules
-
Testing difficulty: Cannot test one without the other
-
Code navigation: Logic split across two codeunits increases cognitive load
Recommended Clarification:
Either merge into single cohesive unit OR clearly separate:
Option A: Merge (if traversal is only used for generation rules)
codeunit "Qlty. Generation Rule Mgmt."
{
procedure FindMatchingGenerationRule(...)
local procedure FindPossibleTargetsBasedOnConfigRecursive(...)
// Traversal becomes implementation detail
}
Option B: Clear Separation (if traversal is reusable)
codeunit "Qlty. Source Config Traversal" // Generic graph traversal
{
procedure FindTargetsRecursive(...) // Generic algorithm
procedure GetRelatedConfigurations(...) // Generic queries
}
codeunit "Qlty. Generation Rule Mgmt." // Business logic
{
procedure FindMatchingGenerationRule(...) // Uses traversal
procedure ValidateRule(...) // Domain-specific
}
Required Investigation:
-
Analyze all usages of QltyTraversal - is it used outside GenerationRuleMgmt?
-
If yes → clarify interface and document as reusable component
-
If no → merge into GenerationRuleMgmt as implementation detail
Effort Estimate: Medium (4-6 hours) - Analysis, decision, refactoring, testing
Expected behavior
Steps to reproduce
Additional context
I will provide a fix for a bug
- I will provide a fix for a bug