Home
Do you declare member accessibility for all classes?
  v1.0 Posted at 26/04/2018 8:48 AM by Tiago Araujo

Not explicitly specifying the access type for members of a structure or class can be deceiving for other developers that are using this structure or class. The default structure and class members access in Visual C# .NET is always private. The default class member access in Visual Basic .NET is private. However, the default structure member access in Visual Basic .NET is public.

Match MatchExpression(string input, string pattern) 

Figure: Bad - Method without member accessibility declared

private Match MatchExpression(string input, string pattern) 

Figure: Good - Method with member accessibility declared

We have a program called SSW Code Auditor to check for this rule.

Related rules

    Do you feel this rule needs an update?

    If you want to be notified when this rule is updated, please enter your email address:

    Comments:

    Note: Social Media login for Yotpo is not working in IE or Safari, please use Chrome. We are waiting for Yotpo to fix it.