Inspection Details

WriteOnlyProperty


Summary
Warns about properties that don't expose a 'Property Get' accessor.
Reasoning
Write-only properties are suspicious: if the client code is able to set a property, it should be allowed to read that property as well. Class design guidelines and best practices generally recommend against write-only properties.
The following code example(s) would trigger this inspection:

Private internalFoo As Long
Public Property Let Foo(ByVal value As Long)
    internalFoo = value
End Property

The following code example(s) would not trigger this inspection:

Private internalFoo As Long
Public Property Let Foo(ByVal value As Long)
    internalFoo = value
End Property
Public Property Get Foo() As Long
    Foo = internalFoo
End Property


Back to List