DtoUsageAnalyzer 1.0.0-beta.1

This is a prerelease version of DtoUsageAnalyzer.
dotnet add package DtoUsageAnalyzer --version 1.0.0-beta.1
                    
NuGet\Install-Package DtoUsageAnalyzer -Version 1.0.0-beta.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DtoUsageAnalyzer" Version="1.0.0-beta.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DtoUsageAnalyzer" Version="1.0.0-beta.1" />
                    
Directory.Packages.props
<PackageReference Include="DtoUsageAnalyzer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DtoUsageAnalyzer --version 1.0.0-beta.1
                    
#r "nuget: DtoUsageAnalyzer, 1.0.0-beta.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DtoUsageAnalyzer@1.0.0-beta.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DtoUsageAnalyzer&version=1.0.0-beta.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=DtoUsageAnalyzer&version=1.0.0-beta.1&prerelease
                    
Install as a Cake Tool

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:

  1. A selection of DTO classes to analyze
  2. Analysis of property usage across the solution
  3. 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 information
  • UserPreferencesProcessor: Processes user preferences (theme, language, notifications, etc.)
  • UserDeviceInfoProcessor: Processes device information (device type, OS, browser, IP)
  • UserSocialMediaProcessor: Processes social media profiles
  • ActivityLogProcessor: Processes user activity logs
  • UserEventProcessor: Processes general event information
  • UserProcessor: 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:

  1. Takes JSON input containing user event data
  2. Deserializes the data into appropriate DTOs
  3. Processes the data and writes formatted output to a TextWriter

License

This project is licensed under the MIT License.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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