Skip to content

Commit b807b9a

Browse files
author
Kapil Borle
committed
Add inline documentation to UseShouldProcess rule
1 parent d1f571e commit b807b9a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Rules/UseShouldProcessCorrectly.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ private bool DeclaresSupportsShouldProcess(FunctionDefinitionAst ast)
244244
return Helper.Instance.GetNamedArgumentAttributeValue(shouldProcessAttribute);
245245
}
246246

247+
/// <summary>
248+
/// Get a CommandInfo object of the given command name
249+
/// </summary>
250+
/// <returns>Returns null if command does not exists</returns>
247251
private CommandInfo GetCommandInfo(string cmdName)
248252
{
249253
try
@@ -263,6 +267,10 @@ private CommandInfo GetCommandInfo(string cmdName)
263267
}
264268
}
265269

270+
/// <summary>
271+
/// Checks if the given command supports ShouldProcess
272+
/// </summary>
273+
/// <returns>False if input is null. If the input command has declares SupportsShouldProcess attribute, returns true</returns>
266274
private bool SupportsShouldProcess(string cmdName)
267275
{
268276
if (String.IsNullOrWhiteSpace(cmdName))
@@ -315,6 +323,9 @@ private bool SupportsShouldProcess(string cmdName)
315323
return false;
316324
}
317325

326+
/// <summary>
327+
/// Add a ShouldProcess edge from a command vertex if the command supports ShouldProcess
328+
/// </summary>
318329
private void CheckForSupportShouldProcess()
319330
{
320331
var commandsWithSupportShouldProcess = new List<Vertex>();
@@ -589,6 +600,9 @@ public bool IsConnected(Vertex vertex, Vertex shouldVertex)
589600
return false;
590601
}
591602

603+
/// <summary>
604+
/// Get the number of edges out of the given vertex
605+
/// </summary>
592606
public int GetOutDegree(Vertex v)
593607
{
594608
return digraph.GetOutDegree(v);

0 commit comments

Comments
 (0)