Zum Hauptinhalt springen

Code Review Checklist

🤖 Generated with Claude Code

⚠️ Not yet reviewed

Co-Authored-By: Claude (noreply@anthropic.com)

Status: Draft

Checklist for human reviewers and AI-assisted code reviews. Items use the normative keywords defined in DOCUMENTATION-GUIDELINES.md, section 7. In a review they read as:

KeywordIn a review
MUSTBlocking — resolve before merge
SHOULDRecommended — deviating needs a stated reason
MAYOptional, at the reviewer's discretion

1. Code Quality​

  • MUST follow established naming conventions (see Project Structure — Namenskonventionen)
  • MUST not introduce dead code, commented-out blocks, or TODO/HACK comments without a linked work item
  • MUST keep methods and classes focused — single responsibility principle
  • SHOULD prefer readability over cleverness
  • SHOULD avoid deep nesting (max 3 levels); extract methods or use early returns
  • SHOULD use meaningful variable and method names that convey intent
  • SHOULD remove unused using statements, imports, and dependencies
  • SHOULD keep methods short — long methods are a signal to extract
  • MAY refactor surrounding code if it improves clarity of the change

.NET / C#​

  • MUST use async/await correctly — no async void (except event handlers), no .Result or .Wait() blocking
  • MUST use nullable reference types (<Nullable>enable</Nullable>) and handle nullability explicitly
  • SHOULD prefer pattern matching and modern C# language features where they improve readability
  • SHOULD use ILogger<T> structured logging instead of string interpolation in log messages

Angular / TypeScript​

  • MUST use strict TypeScript — no any types without justification
  • SHOULD use OnPush change detection strategy where applicable
  • SHOULD unsubscribe from observables or use takeUntilDestroyed / async pipe
  • SHOULD keep components small and delegate logic to services

2. Security​

  • MUST not introduce secrets, credentials, or connection strings in source code
  • MUST validate and sanitize all external input (user input, API responses, query parameters)
  • MUST use parameterized queries — no string concatenation for SQL
  • MUST enforce authentication and authorization on all endpoints
  • MUST not disable HTTPS, certificate validation, or CORS protections without documented justification
  • SHOULD follow the principle of least privilege for API scopes and database permissions
  • SHOULD review for OWASP Top 10 vulnerabilities (injection, XSS, CSRF, broken auth, etc.)
  • SHOULD avoid exposing stack traces or internal error details in API responses

3. Testing​

  • MUST include tests for new functionality
  • MUST not break existing tests — failing tests block merge
  • SHOULD cover edge cases and error paths, not just the happy path
  • SHOULD keep tests independent — no shared mutable state between test cases
  • SHOULD use descriptive test names that express the scenario and expected outcome
  • SHOULD prefer integration tests for API endpoints, unit tests for business logic
  • MAY add performance/load tests for critical paths

4. Performance​

  • MUST not introduce N+1 query patterns in Entity Framework or other ORM usage
  • MUST dispose resources properly (IDisposable, IAsyncDisposable, using statements)
  • SHOULD use AsNoTracking() for read-only EF Core queries
  • SHOULD avoid unbounded queries — use pagination or Take() limits
  • SHOULD use CancellationToken for async operations where available
  • SHOULD be mindful of unnecessary allocations in hot paths (e.g., avoid LINQ in tight loops)
  • MAY consider caching for frequently accessed, rarely changing data

5. Architecture​

  • MUST follow the standard project structure (see Project Structure)
  • MUST target an LTS version of .NET for new projects (see Framework Standards)
  • MUST not introduce circular dependencies between projects or modules
  • SHOULD use dependency injection — avoid new-ing up services with dependencies
  • SHOULD keep API contracts stable — breaking changes require versioning or a migration plan
  • SHOULD follow existing patterns in the codebase rather than introducing new ones without discussion
  • SHOULD keep third-party dependencies to a minimum and prefer well-maintained packages

6. Documentation​

  • MUST update documentation when behavior, APIs, or configuration changes (see DOCUMENTATION-GUIDELINES.md in the repository root)
  • MUST include AI attribution on AI-generated documentation (see DOCUMENTATION-GUIDELINES.md, section "AI Attribution")
  • SHOULD add XML doc comments on public APIs
  • SHOULD update README or relevant docs if the change affects setup, deployment, or usage
  • MAY add inline comments for non-obvious business logic or workarounds