Compare commits
8 Commits
master
...
Zsolt/RSPE
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ff1c316542 | ||
![]() |
1e30208a46 | ||
![]() |
95365a6e7f | ||
![]() |
1ceaed10f8 | ||
![]() |
7f60b1eff0 | ||
![]() |
d3f9afa35d | ||
![]() |
9f0d07611e | ||
![]() |
3b14d578fb |
@ -1,7 +1,7 @@
|
||||
|
||||
[source,csharp,diff-id=1,diff-type=compliant]
|
||||
----
|
||||
void MyMethod(List<MyObject> items)
|
||||
void MyMethod(List<MyObject> items)
|
||||
{
|
||||
logger.Debug("The operation started");
|
||||
foreach(var item in items)
|
||||
|
@ -1,10 +1,10 @@
|
||||
|
||||
[source,csharp,diff-id=1,diff-type=noncompliant]
|
||||
----
|
||||
void MyMethod(List<MyObject> items)
|
||||
void MyMethod(List<MyObject> items)
|
||||
{
|
||||
logger.Debug("The operation started");
|
||||
foreach(var item in items)
|
||||
foreach(var item in items)
|
||||
{
|
||||
logger.Information($"Evaluating {item.Name}"); // Noncompliant
|
||||
var result = Evaluate(item);
|
||||
|
16
rules/S6664/vbnet/compliant.adoc
Normal file
16
rules/S6664/vbnet/compliant.adoc
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
[source,vbnet,diff-id=1,diff-type=compliant]
|
||||
----
|
||||
Private Sub MyMethod(ByVal items As List(Of MyObject))
|
||||
logger.Debug("The operation started")
|
||||
For Each item In items
|
||||
logger.Information($"Evaluating {item.Name}")
|
||||
Dim result = Evaluate(item)
|
||||
If item.Name Is String.Empty Then
|
||||
logger.Error("Invalid item name")
|
||||
End If
|
||||
logger.Information($"End item evaluation with result: {result}")
|
||||
Next
|
||||
logger.Debug("The operation ended")
|
||||
End Sub
|
||||
----
|
13
rules/S6664/vbnet/example.adoc
Normal file
13
rules/S6664/vbnet/example.adoc
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
[source,vbnet]
|
||||
----
|
||||
Private Sub MyMethod(ByVal items As List(Of MyObject))
|
||||
logger.Debug("The operation started")
|
||||
For Each item In items
|
||||
logger.Debug($"Evaluating {item.Name}")
|
||||
Dim result = Evaluate(item)
|
||||
logger.Debug($"Evaluating resulted in {result}")
|
||||
Next
|
||||
logger.Debug("The operation ended")
|
||||
End Sub
|
||||
----
|
2
rules/S6664/vbnet/metadata.json
Normal file
2
rules/S6664/vbnet/metadata.json
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
17
rules/S6664/vbnet/noncompliant.adoc
Normal file
17
rules/S6664/vbnet/noncompliant.adoc
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
[source,vbnet,diff-id=1,diff-type=noncompliant]
|
||||
----
|
||||
Private Sub MyMethod(ByVal items As List(Of MyObject))
|
||||
logger.Debug("The operation started")
|
||||
For Each item In items
|
||||
logger.Information($"Evaluating {item.Name}") ' Noncompliant
|
||||
Dim result = Evaluate(item)
|
||||
logger.Information($"Evaluating resulted in {result}") ' Secondary 1
|
||||
If item.Name Is String.Empty Then
|
||||
logger.Error("Invalid item name")
|
||||
End If
|
||||
logger.Information("End item evaluation") ' Secondary 2
|
||||
Next
|
||||
logger.Debug("The operation ended")
|
||||
End Sub
|
||||
----
|
3
rules/S6664/vbnet/rule.adoc
Normal file
3
rules/S6664/vbnet/rule.adoc
Normal file
@ -0,0 +1,3 @@
|
||||
:language: vbnet
|
||||
|
||||
include::../rule.adoc[]
|
Loading…
x
Reference in New Issue
Block a user