-
-
Notifications
You must be signed in to change notification settings - Fork 114
Closed
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
Description
File: TUnit.Analyzers/AbstractTestClassWithDataSourcesAnalyzer.cs (Lines 107, 153-175)
var allTypes = GetAllNamedTypes(context.Compilation.GlobalNamespace);This recursively walks every type in the entire compilation (including all referenced assemblies) every time an abstract type is analyzed. This is O(n) per abstract test class.
Additionally, data source detection (lines 63-79) uses fragile string-contains checks:
if (typeName.Contains("DataSource") || typeName == "ArgumentsAttribute")Custom data sources without "DataSource" in the name will be missed.
Suggested Fix
- Cache the type hierarchy or restrict search to the current assembly
- Rely on the interface check (
IDataSourceAttribute) instead of string-based matching
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request