rubberduck-vba / Rubberduck

Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
https://rubberduckvba.com
GNU General Public License v3.0
1.92k stars 302 forks source link

Consider specific Annotations for UserForms #6206

Open AlpsDevABE opened 8 months ago

AlpsDevABE commented 8 months ago

What When using Code Inspection for userforms the following items come up:

Ignoring these instances at Module level will apply '@IgnoreModule HungarianNotation Which will suppress any internal variable from marking in the Code.

Why I understand that Systems HungarianNotaion is bad however in user forms you often have multiple control elements representing as single object such as a Label, TextBox and maybe even a button or two. It becomes a nightmare to manage when there is such a bad mix of Data and Logic together and that is just the nature of userforms.

I would recommend something like '@IgnoreUserForm HungarianNotation which would suppress any references to things like lblPassword txtPassword if Password is a Form Control along with any functions that occur for that control without excluding the inspection for Real Code.

Example

'@IgnoreUserForm HungarianNotation 
' This code should not trigger the inspection:
Private Sub cmdCancel_Click()
  ' But this code should
  Dim strPotatoes as String
  strPotatoes = "Why systems hungarian, ugh!!"
End Sub