Back to all reviewers

Use descriptive contextual names

SigNoz/signoz
Based on 3 comments
TSX

Choose variable, method, and property names that clearly communicate their purpose and context to avoid confusion and misinterpretation. Names should be self-explanatory and specific enough that their meaning is unambiguous within their usage context.

Naming Conventions TSX

Reviewer Prompt

Choose variable, method, and property names that clearly communicate their purpose and context to avoid confusion and misinterpretation. Names should be self-explanatory and specific enough that their meaning is unambiguous within their usage context.

Avoid generic or ambiguous names that could have different meanings depending on the context. Instead, use descriptive names that explain both what the identifier represents and how it’s intended to be used.

Consider future extensibility when naming - avoid names that are too specific to current implementation details that might change.

Examples of improvements:

  • HasRunOnExplorercalledFromHandleRunQuery (explains the source/context of the call)
  • hasEditPermissionisEditorOrAdmin (specifies the exact permission level)
  • isTenMinutesTracesTimeRangeuseFocusedTracesTimeRange (describes the behavior, not the specific time constraint)

This practice reduces cognitive load during code reviews and maintenance, making the codebase more self-documenting and less prone to misunderstandings.

3
Comments Analyzed
TSX
Primary Language
Naming Conventions
Category

Source Discussions