SDT0652: RPC Non Prefixed Method Name

Property Value
Rule ID SDT0652
Title RPC Non Prefixed Method Name
Category Network
Severity Warning

Cause

A method decorated with the [RPC] attribute does not start with the prefix RPC_.

Rule Description

For clarity and strict separation of concerns, any method that invokes a Remote Procedure Call over the network should be immediately identifiable in the codebase. Our internal naming convention requires that all RPC methods begin with RPC_.

How to Fix Violations

Rename the method to include the RPC_ prefix.

Violation:

[RPC]
public void UpdateHealth(int newHealth) 
{
    // ...
}

Fix:

[RPC]
public void RPC_UpdateHealth(int newHealth) 
{
    // ...
}

When to Suppress Warnings

Info

You can safely suppress this warning if you are overriding a base method from a third-party library or an older legacy system where changing the method name would break an external contract. However, refactoring is highly recommended.