Skip to content
CAI
Software that uses CAICheck a score

nasraldin/CodeZero

50.5

Weak · 20 September 2026

7.5k

lines of production code

C#

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

CodeZero is a .NET 6 application framework designed to accelerate the development of domain-driven, CQRS-based web services. It provides a standardized infrastructure layer that handles core concerns such as entity auditing, domain event management, and structured error handling. The system simplifies application bootstrapping and configuration through centralized host builders and strongly-typed settings, while integrating essential security, localization, and performance monitoring capabilities.

Features

Domain layer now includes core infrastructure for MediatR pipeline behaviors and entity auditing

The CodeZero.Domain package now provides the foundational infrastructure for request handling and entity management. It introduces MediatR pipeline behaviors for automatic validation, authorization (role and policy-based), performance monitoring, and logging, along with a helper to dispatch domain events from the EF Core change tracker. Additionally, it defines a comprehensive set of base entity interfaces and classes supporting auditing (creation, modification, deletion), soft deletes, concurrency stamps, and active states, enabling consistent entity modeling across the application.

src/CodeZero.Domain · high confidence

Initial release of CodeZero .NET 6 application framework

This change introduces the initial structure for CodeZero, a .NET 6 application framework supporting DDD and CQRS patterns. The repository now includes a solution file (CodeZero.sln) with projects for WebAPI, Domain, Configuration, ServiceInstaller, and shared utilities, along with ARM64 build support. It establishes coding standards via .editorconfig, enforces nullable reference types and implicit usings through Common.props, and integrates SonarAnalyzer and SecurityCodeScan for code quality and security analysis.

(repo-wide) · high confidence

Introduces CodeZeroHostBuilder for centralized application initialization

The CodeZero.Builder package now provides a new \CodeZeroHostBuilder\ class that simplifies ASP.NET Core application startup. This builder automatically configures the host by loading JSON configuration files (including environment-specific, Serilog, and language settings), setting up Kestrel server options (such as hiding the server header), and optionally integrating Serilog for logging. It also handles debug configurations like capturing startup errors and displaying detailed error pages, providing a standardized entry point for initializing CodeZero-based applications.

src/CodeZero.Builder · high confidence

Introduction of CodeZero.Check validation library

The src/CodeZero.Check directory now contains a new static Check class providing parameter validation methods such as NotNull, NotEmpty, NotNullOrEmpty, and HasNoNulls. This library allows developers to enforce argument constraints and receive descriptive exceptions when validation fails, centralizing common input checking logic.

src/CodeZero.Check · high confidence

Introduction of ErrorId struct for logging identification

A new \ErrorId\ readonly struct has been added to the \CodeZero.Logging\ namespace within the shared library. This type provides a structured way to identify errors using a numeric ID and an optional name, supporting equality checks based on the ID and type compatibility. This enables more consistent and identifiable error tracking in logging scenarios.

CodeZero.Shared · high confidence

Introduction of domain infrastructure base classes and event models

The CodeZero.Domain library now includes foundational classes to support domain-driven design patterns. This adds an aggregate root hierarchy (BasicAggregateRoot and AggregateRoot) that manages local and distributed domain events and includes concurrency stamping. It also introduces a suite of audited entity base classes (CreationAudited, AuditedEntity, FullAuditedEntity) that automatically track creation, modification, and soft-deletion timestamps along with associated user references. Additionally, core messaging infrastructure is provided through abstract Event and concrete StoredEvent classes to handle domain event creation and persistence.

CodeZero.Domain · high confidence

Introduction of shared constant definitions for authentication, environments, headers, and MIME types

The CodeZero.Shared.Constants library now provides centralized, strongly-typed constants to standardize configuration and reduce typos across the application. This includes predefined values for authentication schemes (OAuth2, Bearer, ApiKey), environment names (Development, Production, Staging, Dev, Prod, Stag, Test, QA, UAT), common HTTP header names (such as Authorization, Api-Key, and various security headers), and standard MIME types (including JSON, PDF, images, and multipart formats).

src/CodeZero.Shared.Constants · high confidence

New configuration loading and environment helper utilities

This change introduces the \CodeZero.Configuration\ library, providing a centralized way to load and access application settings. It adds an \AppServiceLoader\ singleton to expose the current \IWebHostEnvironment\, \IConfiguration\, and application name, along with a generic \Config\<T\>\ class for strongly-typed access to configuration sections. The \AppServiceLoaderExtensions\ class registers these services in the DI container via the \AddAppServiceLoader\ extension method. Additionally, it includes \HostingEnvironmentExtensions\ for convenient environment checks (e.g., \IsDev\, \IsProd\) and a set of configuration model classes (e.g., \ServiceSettings\, \RedisConfig\, \Jwt\) to define the structure of application settings.

src/CodeZero.Configuration · high confidence

New shared exception hierarchy and logging utilities

The CodeZero.Shared library now includes a structured exception hierarchy with base types like CodeZeroException, BusinessException, and specific variants such as NotFoundException and UserFriendlyException, along with interfaces for error codes, details, and log levels. It also introduces comprehensive logging extensions, including CodeZeroLoggerExtensions for structured exception logging, EFCoreLoggingUtils for query scoping, and a predefined set of common HTTP error codes, enabling consistent error handling and observability across the application.

src/CodeZero.Shared · high confidence

ServiceInstaller now provides comprehensive configuration models and DI extensions for security, localization, and performance

The ServiceInstaller library has been expanded to include a full suite of configuration models and corresponding dependency-injection extensions. Users can now configure security features including JWT authentication, CORS policies, antiforgery tokens, HTTP headers, HSTS, and HTTPS redirection via dedicated extension methods. The library also adds support for application localization (culture negotiation), response compression (Brotli/Gzip), reverse proxy/forwarded headers, and data protection key persistence to Redis or the file system. Additionally, it integrates MiniProfiler for debugging and AspNetCoreRateLimit for IP/client-based rate limiting, all driven by strongly-typed configuration sections.

src/CodeZero.ServiceInstaller · high confidence

Test coverage

Added test scaffolding for WebAPI project structure and configuration

Added a comprehensive set of scaffolding files for the WebAPI project within the test suite, including the WeatherForecast controller, domain entities (Language, BaseEntity), persistence layers (ApplicationDbContext, initializers, and AuditableEntitySaveChangesInterceptor), and host builder configuration. The entry also includes EF Core migration files for the initial database schema, configuration files (appsettings), and Swagger UI customization, establishing the structural baseline for the application's test environment.

tests · 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

Score

  • CAI 54 → 50 (-4.0)
  • Rubric changed (rubric-2026.08.17 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 70 → 62 (-7.7)
  • Architecture 97 → 97 (+0.0)
  • Maturity 88 → 88 (-0.1)
  • Readiness 45 → 35 (-9.6)
  • Security 62 → 58 (-3.8)
  • Domain Modelling 58 → 80 (+22.4)
  • Performance 61 → 61 (+0.0)

Resolved (31)

  • Auditing properties for creation and deletion are inconsistent. Some use 'CreatedBy'/'CreatedAt' (noun/verb mix), while others use 'DeleterUser'/'DeletionTime'. The pattern for creation is 'XBy'/'XAt', but deletion uses 'DeleterUser'/'DeletionTime'.
  • Bounded contexts not declared
  • CommentedOutCode (src/CodeZero.Domain/DomainEventDispatcher.cs)
  • CommentedOutCode (src/CodeZero.Domain/DomainEventDispatcher.cs)
  • CommentedOutCode (src/CodeZero.Domain/DomainEventDispatcher.cs)
  • CommentedOutCode (src/CodeZero.Domain/DomainEventDispatcher.cs)
  • CommentedOutCode (tests/WebAPI/Domain/ApplicationDbContext.cs)
  • CommentedOutCode (tests/WebAPI/Domain/ApplicationDbContext.cs)
  • CommentedOutCode (tests/WebAPI/Domain/ApplicationDbContext.cs)
  • CommentedOutCode (tests/WebAPI/Domain/ApplicationDbContext.cs)
  • CommentedOutCode (tests/WebAPI/Domain/ApplicationDbContext.cs)
  • CommentedOutCode (tests/WebAPI/Domain/ApplicationDbContext.cs)
  • CommentedOutCode (tests/WebAPI/Domain/ApplicationDbContext.cs)
  • CommentedOutCode (tests/WebAPI/Identity/ApplicationUser.cs)
  • CommentedOutCode (tests/WebAPI/Identity/IdentityService.cs)
  • CommentedOutCode (tests/WebAPI/Identity/IdentityService.cs)
  • CommentedOutCode (tests/WebAPI/Identity/IdentityService.cs)
  • Duplicated block (16 lines × 2) (src/CodeZero.ServiceInstaller/Libraries/RateLimit/Stores/RedisRateLimitCounterStore.cs)
  • Duplicated block (16 lines × 2) (src/CodeZero.StringExtensions/System/StringExtensions.cs)
  • Duplicated block (16–24 lines × 2) (src/CodeZero.StringExtensions/System/StringExtensions.cs)
  • …and 11 more

New (33)

  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • CommentedOutCode (src/CodeZero.ServiceInstaller/Libraries/Swagger/SwaggerExtensions.cs)
  • CommentedOutCode (src/CodeZero.ServiceInstaller/Libraries/Swagger/SwaggerExtensions.cs)
  • Deprecated: Serilog.Sinks.MariaDB
  • Documentation: no installation or build instructions (README.md)
  • DuplicateNoWarn (Common.props)
  • Duplicated block (12 lines × 2) (src/CodeZero.Shared/Microsoft/Extensions/Logging/CodeZeroLoggerExtensions.cs)
  • Duplicated block (13 lines × 2) (src/CodeZero.ServiceInstaller/Libraries/RateLimit/Stores/RedisRateLimitCounterStore.cs)
  • Duplicated block (17 lines × 2) (src/CodeZero.ServiceInstaller/Libraries/RateLimit/Stores/RedisRateLimitCounterStore.cs)
  • Duplicated block (17 lines × 2) (src/CodeZero.ServiceInstaller/Libraries/RateLimit/Stores/RedisRateLimitCounterStore.cs)
  • Duplicated block (21–29 lines × 2) (src/CodeZero.StringExtensions/System/StringExtensions.cs)
  • Duplicated block (23 lines × 2) (src/CodeZero.Shared/Microsoft/Extensions/Logging/CodeZeroLoggerExtensions.cs)
  • Duplicated block (35 lines × 2) (src/CodeZero.StringExtensions/System/StringExtensions.cs)
  • End-of-life runtime: .NET net6.0
  • Hotspot: src/CodeZero.ServiceInstaller/Extensions/CorsConfigExtensions.cs (src/CodeZero.ServiceInstaller/Extensions/CorsConfigExtensions.cs)
  • Hotspot: src/CodeZero.ServiceInstaller/Extensions/ReverseProxy/ReverseProxyExtensions.cs (src/CodeZero.ServiceInstaller/Extensions/ReverseProxy/ReverseProxyExtensions.cs)
  • Hotspot: src/CodeZero.ServiceInstaller/ServiceInstallers/ApplicationBuilderExtensions.cs (src/CodeZero.ServiceInstaller/ServiceInstallers/ApplicationBuilderExtensions.cs)
  • …and 13 more

Architecture

  • Unchanged — 1 containers · 2 contexts · 1 edges

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

nasraldin/CodeZero 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 20 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 f3b01e2013531ea7e7b0f1e9c3dbbe5d5ebfd949 — 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.