Back to all reviewers

Document non-obvious logic

dotnet/runtime
Based on 2 comments
C

Add clear comments explaining the purpose and reasoning behind complex or non-obvious code logic. Comments should explain 'why' certain implementation choices were made or how specific variables and conditions function, rather than just restating what the code does. This is especially important for security-related checks, timing mechanisms, interruption...

Documentation C

Reviewer Prompt

Add clear comments explaining the purpose and reasoning behind complex or non-obvious code logic. Comments should explain ‘why’ certain implementation choices were made or how specific variables and conditions function, rather than just restating what the code does. This is especially important for security-related checks, timing mechanisms, interruption handling, and specialized attribute usage.

For example:

/* Tracks the starting time of the wait loop to calculate the remaining timeout
 * when re-entering the loop after an interruption. */
DWORD start_ticks = GetTickCount();

// OR

/* Skip inlining methods requiring security objects to prevent
 * security context bypass vulnerabilities */
if (target_method->flags & METHOD_ATTRIBUTE_REQSECOBJ) {
    return FALSE;
}
2
Comments Analyzed
C
Primary Language
Documentation
Category

Source Discussions