DtoUsageAnalyzer 1.0.0-beta.1
dotnet add package DtoUsageAnalyzer --version 1.0.0-beta.1
NuGet\Install-Package DtoUsageAnalyzer -Version 1.0.0-beta.1
<PackageReference Include="DtoUsageAnalyzer" Version="1.0.0-beta.1" />
<PackageVersion Include="DtoUsageAnalyzer" Version="1.0.0-beta.1" />
<PackageReference Include="DtoUsageAnalyzer" />
paket add DtoUsageAnalyzer --version 1.0.0-beta.1
#r "nuget: DtoUsageAnalyzer, 1.0.0-beta.1"
#:package DtoUsageAnalyzer@1.0.0-beta.1
#addin nuget:?package=DtoUsageAnalyzer&version=1.0.0-beta.1&prerelease
#tool nuget:?package=DtoUsageAnalyzer&version=1.0.0-beta.1&prerelease
Usage Analyzer
A .NET solution for processing and analyzing user event data.
For a high-level overview of the codebase, see docs/CodebaseOverview.md.
Project Structure
The solution consists of the following projects:
- Dto: Contains data transfer objects used for deserializing user event data
- Processors: Contains processors for handling different types of user data
- Dto.Tests: Unit tests for the DTO project
- Processors.Tests: Unit tests for the Processors project
- DtoUsageAnalyzer: Library that implements the Roslyn-based analysis service
- Analyze: Main application project for analyzing user data using
DtoUsageAnalyzer
DtoUsageAnalyzer Library
DtoUsageAnalyzer
exposes an AnalysisService
that performs Roslyn-based code analysis. By referencing this
library, other applications and unit tests can run the same usage analysis logic as the console app.
Getting Started
Prerequisites
- .NET 8.0 SDK or later
- Your favorite IDE (Visual Studio, VS Code, etc.)
Building the Solution
dotnet build
Running the Application
To run the Analyze application:
cd Analyze
dotnet run
The application is a DTO Usage Analyzer that helps you understand how DTO classes and their properties are used throughout your solution. It provides:
- A selection of DTO classes to analyze
- Analysis of property usage across the solution
- Detailed reports showing:
- Total usage count for each property
- Usage distribution across different files
- Identification of unused properties
The tool helps identify:
- Which DTO properties are most frequently used
- Where specific properties are being accessed
- Potentially unused properties that might be candidates for removal
Running Tests
The solution includes comprehensive unit tests for both DTOs and Processors. Run the tests using:
dotnet test
Usage
The solution provides several processors for handling different types of user data:
UserAddressProcessor
: Processes user address informationUserPreferencesProcessor
: Processes user preferences (theme, language, notifications, etc.)UserDeviceInfoProcessor
: Processes device information (device type, OS, browser, IP)UserSocialMediaProcessor
: Processes social media profilesActivityLogProcessor
: Processes user activity logsUserEventProcessor
: Processes general event informationUserProcessor
: Processes core user information (profile, preferences, activity)
Example usage:
// Create a processor instance
var processor = new UserAddressProcessor();
// Process the JSON input
using var writer = new StringWriter();
processor.Process(jsonInput, writer);
var result = writer.ToString();
Each processor follows the same pattern:
- Takes JSON input containing user event data
- Deserializes the data into appropriate DTOs
- Processes the data and writes formatted output to a TextWriter
License
This project is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.Build.Tasks.Core (>= 17.14.8)
- Microsoft.CodeAnalysis.CSharp (>= 4.14.0)
- Microsoft.CodeAnalysis.CSharp.Workspaces (>= 4.14.0)
- Microsoft.CodeAnalysis.Workspaces.MSBuild (>= 4.14.0)
- Microsoft.Extensions.Logging (>= 10.0.0-preview.4.25258.110)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0-beta.1 | 92 | 8/13/2025 |