ardalis/GuardClauses
65.4
Adequate · 21 September 2026
3.1k
lines of production code
C#
primary language
4
measurements over time
What this system is
Ardalis.GuardClauses is a .NET library designed to simplify input validation by providing extension methods that enforce preconditions on method arguments. It supports custom exception types and automatically captures parameter names to reduce boilerplate code. The system includes built-in checks for nulls, empty strings, invalid formats, and numeric ranges, along with a specific exception for missing queried objects. It is distributed as a NuGet package targeting .NET 8 and .NET Standard, with comprehensive unit tests ensuring reliability.
Features
Added NotFoundException for missing queried objects
A new NotFoundException class has been introduced to represent errors when a queried object is not found. This exception accepts the object name and query key, providing a descriptive message, and supports an inner exception for chaining.
src/GuardClauses/Exceptions · high confidence
Added application logo assets
The media directory now includes a new logo asset, provided as an Adobe Illustrator file (logotype 1024.ai) and multiple SVG variants (48, 72, 96, 144, 256, 512, and logotype 1024). These files, generated from CorelDRAW X7, supply the visual branding assets for the application.
media · high confidence
Initial project structure and documentation
This change introduces the foundational structure for the Ardalis.GuardClauses library, including the solution file, project configuration (Directory.Build.props), and an .editorconfig enforcing .NET coding conventions. It also adds essential documentation files such as README.md, CONTRIBUTING.md, and CODE\_OF\_CONDUCT.md, along with build artifacts like the Azure Pipelines backup and NuGet publishing instructions.
(repo-wide) · high confidence
Behavioural changes
Guard clauses now support custom exceptions and automatic parameter names
The guard clause extension methods in src/GuardClauses have been updated to accept an optional Func\<Exception\> exceptionCreator parameter, allowing users to supply custom exception types instead of the default ArgumentException or ArgumentNullException. Additionally, the methods now use the CallerArgumentExpression attribute to automatically capture the parameter name from the call site, removing the need for manual string arguments and reducing boilerplate. Deprecated methods like AgainstExpression have been marked obsolete in favor of the new Expression methods which use reversed validation logic.
src/GuardClauses · high confidence
Incorporates JetBrains.Annotations source code with internal modifiers
The project now includes the JetBrains.Annotations source file directly within the codebase, with all attribute classes modified to be internal and sealed. This change embeds the nullability and annotation attributes locally, ensuring that IDE tooling and static analysis features (such as null-reference warnings) function correctly without requiring an external NuGet package dependency.
src/GuardClauses/ThirdParty · high confidence
Test coverage
Added unit tests for custom guard extensions; Expanded unit test coverage for guard clauses.
Dependencies
Ardalis.GuardClauses 5.0 targets .NET 8 and updates test infrastructure
The library has been updated to version 5.0.0 and now targets .NET 8.0 alongside .NET Standard 2.0 and 2.1. The project file includes an icon and a README file in the NuGet package, and explicitly sets the MIT license. The test project has been upgraded to .NET 8.0 and updated to use the latest versions of xUnit (2.9.3), Microsoft.NET.Test.Sdk (18.9.0), and coverage tools (altcover 9.0.102, coverlet 10.0.1).
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 55 → 65 (+10.7)
- Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 81 → 76 (-4.7)
- Architecture 100 → 100 (+0.0)
- Maturity 46 → 54 (+8.4)
- Readiness 76 → 74 (-1.9)
- Security 52 → 78 (+26.3)
- Performance 62 → 72 (+10.3)
Resolved (25)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- LLM evaluation failed
- No exposed public API
- ObsoleteWithoutCallers (src/GuardClauses/ThirdParty/JetBrains.Annotations.cs)
- Orphaned knowledge (src/GuardClauses/ThirdParty/JetBrains.Annotations.cs)
- Outdated: ReportGenerator
- …and 5 more
New (22)
- Documentation: no installation or build instructions (README.md)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Low coverage: src/GuardClauses/GuardAgainstExpressionExtensionsDeprecated.cs (src/GuardClauses/GuardAgainstExpressionExtensionsDeprecated.cs)
- Low coverage: src/GuardClauses/ThirdParty/JetBrains.Annotations.cs (src/GuardClauses/ThirdParty/JetBrains.Annotations.cs)
- Medium: security finding (details withheld)
- …and 2 more
Changes since last survey
- 2 commits — 1 feature/other, 1 fixes
By area
- .github/workflows — 1 commit
- src/GuardClauses — 1 commit
Notable commits
- fix: fix: remove struct constraint from Guard.Against.Expression to support reference types (#339) (#406)
- change: Update NuGet dependencies and GitHub Actions to latest (#410)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
ardalis/GuardClauses was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit f96b823e4228252b2927cce3effa550c16b558a5 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.