mit einem Klick
code-review
// Perform a systematic code review of all source files, focusing on security, performance, backwards compatibility, and design principles.
// Perform a systematic code review of all source files, focusing on security, performance, backwards compatibility, and design principles.
Ensure that C# and C++/CLI types are documented with XML comments and follow best practices for documentation.
Prepare the DSInternals project for a new release by updating version numbers, release notes, and changelog.
Update copyright year references across the project at the beginning of each calendar year.
| name | code-review |
| description | Perform a systematic code review of all source files, focusing on security, performance, backwards compatibility, and design principles. |
These instructions guide code reviews for the DSInternals repository, which contains C#, C++/CLI, and PowerShell code for Active Directory security auditing, offline database manipulation, and password management. Focus on higher-level concerns that require expert judgment rather than stylistic or syntactic issues handled by automated tooling.
If there are no code changes to review, perform a review of the entire codebase based on these guidelines to identify potential improvements or issues. Do not rely solely on targeted searches for specific artefacts. Systematically read all source files to ensure comprehensive coverage. For each file read, apply all the review priorities documented below. Do not skip files even if they appear simple—security issues often hide in seemingly innocuous code.
Critical Security Concerns (Especially Important for AD Security Tooling):
SecureString where appropriate for password inputArray.Clear() or CryptographicOperations.ZeroMemory() in finally blocksRandomNumberGenerator for cryptographically secure random bytes, never System.RandomCryptographicOperations.FixedTimeEquals() to prevent timing attacksPath.GetFullPath() and validate paths are within expected directoriesToString() overrides don't expose sensitive fieldsCryptographicException appropriately; avoid leaking information about why decryption failedPerformance Considerations:
Span<T>, stackalloc, or object pooling where appropriateConfigureAwait(false) in library code (DSInternals Framework) to avoid deadlocks and improve performanceasync void except for event handlers; use async Task insteadCancellationToken for long-running operations (database enumeration, RPC calls)ValueTask over Task for hot paths that often complete synchronously.Result, .Wait(), or .GetAwaiter().GetResult() in async contexts)Task.Run() to wrap synchronous code in library methods; let the caller decideCompatibility Requirements:
Integration Points:
Code Correctness:
Design Quality:
Test Quality:
Native Code Quality:
std::unique_ptr and std::vector over raw pointers and C-style arrays where possibleSecureZeroMemory() to clear sensitive data before freeingMIDL_user_allocate() with MIDL_user_free()__try/__except) for Win32 exceptions where appropriateC++/CLI Security:
/GS (Buffer Security Check) compiler flag is enabledSafeInt<T> or check for overflow before arithmetic operations on sizes/lengths_s suffixed functions (strcpy_s, memcpy_s, sprintf_s) over unsafe versionsprintf-family functions_alloca() or prefer heap allocation for variable-sized buffersCmdlet Quality:
Documentation:
The following are handled by automated tooling and don't need review comments:
.editorconfig and analyzers)