Analysis Roadmap
1. Goal
Provide a concrete set of investigative steps to answer the "How" for:
- Performance Bottlenecks (Immediate Relief)
- Refactoring Prioritization (Strategic Planning)
- Security Vulnerabilities (Risk Mitigation)
- Docker/CD Migration (Modernization)
- Automated Testing & Living Documentation (Quality Assurance)
2. Roadmap
2.1. Performance Analysis
- Goal: Identify "N+1" queries and slow synchronous I/O.
- Tool: MiniProfiler.
- Steps:
- Install
MiniProfiler.Mvc4NuGet package inWepNG_OMGT. - Add
MiniProfiler.Start()inGlobal.asax.cs(Application_BeginRequest). - Navigate to
Order/Listpage and observe query counts. - Document "Top 5 Slowest Requests".
- Install
2.2. Refactoring Prioritization (Hotspot Analysis)
- Goal: Find code that is both Complex and Frequently Changed.
- Method: Hotspot Analysis Methodology.
- Results: See Hotspot Analysis Results.
- Findings (Preliminary):
WEPV2ModelBuilder.cs(261 changes) -> Critical Risk.OrderOMGT.cs(120 changes) -> High Domain Complexity.
- Steps:
- Run formal "Hotspot Analysis" (Complexity vs Churn).
- Flag files > 1000 lines with > 50 commits/year.
2.3. Security Analysis
- Goal: Identify critical vulnerabilities (Secrets, SQLi, Legacy Auth).
- Findings (Preliminary):
- Secrets:
Web.configcontains cleartext SQL passwords and hardcodedmachineKey. - Auth: Uses legacy
SqlMembershipProvider(potentially weak hashing). - XSS:
requestValidationMode="2.0"implies degraded cross-site scripting protection. - WepAccess: Identified as Collaborator Portal with high-risk authorization logic (see Analysis).
- Secrets:
- Results: See Security Audit Findings.
- Steps:
- Secret Audit: Search for
Password=,ApiKey, and AWS/Azure keys in code. - Validation Audit: Grep for
[ValidateInput(false)]andAllowHtmlin Controllers/Models. - SQL Injection Scan: Search for
ExecuteSqlCommandand string concatenation inWepNG_Business. - Verify Config: Check
compilation debug="false"andcustomErrorsin production config.
- Secret Audit: Search for
2.4. Infrastructure & Continuous Deployment (Docker)
- Goal: Containerize the Monolith (Windows Container).
- Strategy: Hybrid Strangler Fig (Docker Migration Strategy).
- Blockers Identified:
- Hardcoded local paths (
C:\Projects,C:\Temp). - Local IIS Dependencies (
App_Pool). - Local File System Dependencies (
EIT_Packagesrelative paths).
- Hardcoded local paths (
- Steps:
- Strategy Definition: Defined Hybrid Strangler + Logic Side-car approach.
- Configuration: Replace
C:\TempwithEnvironment.GetEnvironmentVariable("WEP_TEMP"). - Dependencies: Move
EIT_Packagesto a private NuGet feed or vendor them inside the repo properly. - Container: Create
Dockerfilebased onmcr.microsoft.com/dotnet/framework/aspnet:4.8.
2.5. Reporting Evolution
- Goal: Move from Embedded BI / Monolithic Reporting to Zoho Analytics.
- Analysis: Reporting Analysis.
- Steps:
- Analysis: Identified WA "Feeders" and BO "DevExpress" as key legacy debts.
- Freeze Feeders: Enforce "No new logic in C# Feeders" policy.
- ETL Prototype: Create data export job for Orders/Invoices to Zoho.
- Inventory: Catalog all BO Reports to separate "Analytical" vs "Operational".
2.6. Refactoring & Cleanup
- Goal: Remove dead code to reduce cognitive load.
- Steps:
- Zombie Cleanup: Delete
Formsmodule (vestigial). - Legacy Retirement: Retire
INETmodule (internal notes).
- Zombie Cleanup: Delete
2.7. Automated Testing & Living Documentation
- Goal: Break the "Legacy Code Dilemma" and document business rules.
- Strategy: Hybrid approach (Unit Tests for logic, Gherkin for behavior).
- Steps:
- Unit Testing (Seams):
- Create
WepNG.Testsproject (.NET 4.8). - Install
xUnitandFluentAssertions. - Target
EITWEP.WEPUtils(Pure functions). - Extract interfaces from "God Services" to enable mocking.
- Create
- Living Documentation (Gherkin):
- Strategy: Gherkin Strategy.
- Plan: Implementation Roadmap.
- Execution: Setup
WepNG.Tests.SpecsandFeeControllerPilot.
- Unit Testing (Seams):
2.8. Functional Specification Pilot (OMGT)
- Goal: Validate the Hybrid Specification Strategy.
- Strategy: Functional Strategy.
- Steps:
- Dashboard Logic (Gherkin):
AppFeeNotPaidFirstReminder. - User Task (Use Case):
AssignCallback(with Gap Analysis). - Workflow (State Diagram):
PlacementRequestLifecycle.
- Dashboard Logic (Gherkin):
2.9. OMGT Modernization Pilot (Priority Engine)
- Goal: Validate "Async Calculation" and "Side-car Logic" patterns on legacy entities without blocking the monolith.
- Specification: Priority Index Specification.
- Deliverables:
- Schema: Add
PriorityScoretoOrderTravelProductOMGT. - Service: Implement
OrderPriorityService(Pure C#). - Async Trigger: Implement Fire-and-Forget hook on
Save(). - Dashboard: Sort by
PriorityScore.
- Schema: Add