Class Suppression
Processor for rule suppressions
public class Suppression
- Inheritance
-
Suppression
- Inherited Members
Constructors
Suppression(TextContainer, int)
public Suppression(TextContainer text, int lineNumber)
Parameters
text
TextContainerlineNumber
int
Suppression(string)
Creates new instance of Supressor
public Suppression(string text)
Parameters
text
stringText to work with
Fields
KeywordAll
protected const string KeywordAll = "all"
Field Value
KeywordBy
protected const string KeywordBy = "by"
Field Value
KeywordIgnore
protected const string KeywordIgnore = "ignore"
Field Value
KeywordPrefix
protected const string KeywordPrefix = "DevSkim:"
Field Value
KeywordUntil
protected const string KeywordUntil = "until"
Field Value
pattern
public const string pattern = "DevSkim:\\s+ignore\\s([a-zA-Z\\d,:]+)(\\s+until\\s\\d{4}-\\d{2}-\\d{2}|)(\\s+by\\s([A-Za-z0-9_]+)|)"
Field Value
Properties
ExpirationDate
Suppression expiration date
public DateTime ExpirationDate { get; }
Property Value
GetSuppressedIds
public string[] GetSuppressedIds { get; }
Property Value
- string[]
Index
Suppression expresion start index on the given line
public int Index { get; }
Property Value
IsExpired
Check if the suppression has expired
public bool IsExpired { get; }
Property Value
IsInEffect
Validity of suppression expresion
public bool IsInEffect { get; }
Property Value
- bool
True if suppression is in effect
IssuesListIndex
Position of issues list
public int IssuesListIndex { get; set; }
Property Value
Length
Suppression expression length
public int Length { get; }
Property Value
Reviewer
Get the optional manual reviewer
public string Reviewer { get; }
Property Value
_expirationDate
protected DateTime _expirationDate { get; set; }
Property Value
_issues
protected List<SuppressedIssue> _issues { get; set; }
Property Value
_lineNumber
protected int _lineNumber { get; set; }
Property Value
_lineText
protected string _lineText { get; set; }
Property Value
_suppressLength
protected int _suppressLength { get; set; }
Property Value
_suppressStart
protected int _suppressStart { get; set; }
Property Value
_text
protected TextContainer? _text { get; set; }
Property Value
- TextContainer
reg
protected Regex reg { get; set; }
Property Value
Methods
GetIssues()
Get issue IDs for the suppression
public virtual SuppressedIssue[] GetIssues()
Returns
- SuppressedIssue[]
List of issue IDs
GetSuppressedIssue(string)
Test if given rule Id is being suppressed
public SuppressedIssue? GetSuppressedIssue(string issueId)
Parameters
issueId
stringRule ID
Returns
- SuppressedIssue
True if rule is suppressed
ParseLine()
protected void ParseLine()