2021-01-21 04:09:13 +00:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
|
|
|
|
----
|
|
|
|
Public Class Foo
|
|
|
|
|
2021-01-23 04:07:47 +00:00
|
|
|
Private Name As String = "foobar" ' Noncompliant
|
2021-01-21 04:09:13 +00:00
|
|
|
|
|
|
|
Public ReadOnly Property DefaultName As String = "foobar" ' Noncompliant
|
|
|
|
|
2021-01-23 04:07:47 +00:00
|
|
|
Public Sub New(Optional Value As String = "foobar") ' Noncompliant
|
2021-01-21 04:09:13 +00:00
|
|
|
|
2021-01-23 04:07:47 +00:00
|
|
|
Dim Something = If(Value, "foobar") ' Noncompliant
|
2021-01-21 04:09:13 +00:00
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
End Class
|
|
|
|
----
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
----
|
|
|
|
Public Class Foo
|
|
|
|
|
|
|
|
Private Const Foobar As String = "foobar"
|
|
|
|
|
2021-01-23 04:07:47 +00:00
|
|
|
Private Name As String = Foobar
|
2021-01-21 04:09:13 +00:00
|
|
|
|
|
|
|
Public ReadOnly Property DefaultName As String = Foobar
|
|
|
|
|
2021-01-23 04:07:47 +00:00
|
|
|
Public Sub New(Optional Value As String = Foobar)
|
2021-01-21 04:09:13 +00:00
|
|
|
|
2021-01-23 04:07:47 +00:00
|
|
|
Dim Something = If(Value, Foobar)
|
2021-01-21 04:09:13 +00:00
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
End Class
|
|
|
|
----
|
|
|
|
|
|
|
|
== Exceptions
|
|
|
|
|
|
|
|
The following are ignored:
|
|
|
|
|
|
|
|
* literals with fewer than 5 characters
|
|
|
|
* literals matching one of the parameter names
|
|
|
|
* literals used in attributes
|
2021-06-02 20:44:38 +02:00
|
|
|
|
2021-06-03 09:05:38 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
2021-09-20 15:38:42 +02:00
|
|
|
|
|
|
|
'''
|
|
|
|
== Implementation Specification
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::message.adoc[]
|
|
|
|
|
|
|
|
include::../parameters.adoc[]
|
|
|
|
|
|
|
|
include::highlighting.adoc[]
|
|
|
|
|
2021-06-08 15:52:13 +02:00
|
|
|
'''
|
2021-06-02 20:44:38 +02:00
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
2021-06-03 09:05:38 +02:00
|
|
|
endif::env-github,rspecator-view[]
|