RDC00408: Underscore in a public class member
Severity: Warning · Family: RDC (Rubberduck Core analyzers) ·
Raised by: UnderscoreInPublicClassMemberAnalyzer
A public member of a class module has an underscore in its name.
The public members of a class module are its interface, which another class module can implement with Implements. The implementation of a member is named
after the interface, an underscore, and the member (IShape_Draw), so a member whose own name has an underscore cannot be implemented: an Implements of
the class is VBC09328 (RD-VBAL §5.2.4.2 Implements Directive).
The members of the interface are the Public procedures and properties, the ones that state no access, and the Public variables. An implementation of an
interface member and an event handler are not reported: RDC00405 reports them when they are public. Only what the module's code declares is
reported: the members that a form's designer declares on the form's class, such as its controls and the hidden members of Microsoft Forms' UserForm, are not.
The finding is the declaration of the member.
How it is raised
| Situation | Example | Resolution |
|---|---|---|
A Public procedure of a class module with an underscore in its name. |
Public Sub Do_Something()End Sub |
Rename it with no underscore (DoSomething), or make it Private. |
A Public variable of a class module with an underscore in its name. |
Public Max_Size As Long |
Rename it with no underscore. |
See also
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca