Oakrey.CodeAnalyzers
1.0.0
dotnet add package Oakrey.CodeAnalyzers --version 1.0.0
NuGet\Install-Package Oakrey.CodeAnalyzers -Version 1.0.0
<PackageReference Include="Oakrey.CodeAnalyzers" Version="1.0.0" />
<PackageVersion Include="Oakrey.CodeAnalyzers" Version="1.0.0" />
<PackageReference Include="Oakrey.CodeAnalyzers" />
paket add Oakrey.CodeAnalyzers --version 1.0.0
#r "nuget: Oakrey.CodeAnalyzers, 1.0.0"
#:package Oakrey.CodeAnalyzers@1.0.0
#addin nuget:?package=Oakrey.CodeAnalyzers&version=1.0.0
#tool nuget:?package=Oakrey.CodeAnalyzers&version=1.0.0
Oakrey.CodeAnalyzers
The Oakrey.CodeAnalyzers
package provides a collection of Roslyn-based code analyzers designed to help .NET developers enforce best practices, improve code quality, and catch common issues early in the development process. These analyzers target a range of code patterns, from async usage to exception handling and code maintainability.
Features
Async and Task Usage
- Detects and warns against the use of
async void
methods (AsyncVoidAnalyzer
). - Ensures that methods accepting cancellation should use
CancellationToken
(MissingCancellationTokenAnalyzer
).
- Detects and warns against the use of
Exception Handling
- Flags general
catch
blocks that may hide errors (GeneralCatchAnalyzer
). - Detects silent catch blocks that swallow exceptions without handling or logging (
SilentCatchAnalyzer
).
- Flags general
Code Maintainability
- Identifies files containing multiple class declarations (
MultipleClassesInOneFileAnalyzer
). - Highlights the use of
Thread.Sleep
which can block threads and degrade performance (ThreadSleepAnalyzer
). - Detects TODO and FIXME comments to help track technical debt (
TodoFixMeAnalyzer
).
- Identifies files containing multiple class declarations (
Security and Reliability
- Flags potential PII (Personally Identifiable Information) data patterns in code (
PIIDataPatternAnalyzer
). - Ensures regular expressions have timeouts to prevent ReDoS vulnerabilities (
RegexTimeoutAnalyzer
).
- Flags potential PII (Personally Identifiable Information) data patterns in code (
Installation
You can install the package via NuGet Package Manager, Package Manager Console or the .NET CLI.
NuGet Package Manager
- Open your project in Visual Studio.
- Navigate to Tools > NuGet Package Manager > Manage NuGet Packages for Solution....
- Search for
Oakrey.CodeAnalyzers
and click Install.
.NET CLI
Run the following command in your terminal:
dotnet add package Oakrey.CodeAnalyzers
Package Manager Console
Run the following command in your Package Manager Console:
Install-Package Oakrey.CodeAnalyzers
Requirements
- .NET 8 or higher
Project Information
- Author: Oakrey
- Company: Oakrey
- License: MIT
- Repository: Git Repository
- Project URL: Project Website
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests to improve the package.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.CodeAnalysis.CSharp (>= 4.14.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Oakrey.CodeAnalyzers:
Package | Downloads |
---|---|
Oakrey.ASRockService.Common
Shared contracts and data types for ASRockService, enabling .NET applications to interact with ASRock motherboard GPIO and power management features. Includes service interfaces and models for device and pin information. Designed for use in both client and server scenarios. |
|
Oakrey.HardwareManager.Client.Common
A foundational .NET library providing shared abstractions, base classes, and utilities for building hardware client applications. Includes device and channel models, connection management, error handling, and serialization support for the Oakrey HardwareManager ecosystem. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0 | 171 | 7/8/2025 |