forked from PowerShell/PSScriptAnalyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExternalRule.cs
More file actions
96 lines (78 loc) · 2.47 KB
/
ExternalRule.cs
File metadata and controls
96 lines (78 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//
// Copyright (c) Microsoft Corporation.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic
{
internal class ExternalRule : IExternalRule
{
#region Methods
string name = string.Empty;
string commonName = string.Empty;
string desc = string.Empty;
string param = string.Empty;
string srcName = string.Empty;
string modPath = string.Empty;
string paramType = string.Empty;
public string GetName()
{
return this.name;
}
public string GetCommonName()
{
return this.commonName;
}
public string GetDescription()
{
return this.desc;
}
public string GetParameter()
{
return this.param;
}
public SourceType GetSourceType()
{
return SourceType.Module;
}
public string GetParameterType()
{
return this.paramType;
}
//Set the community rule level as warning as the current implementation does not require user to specify rule severity when defining their functions in PS scripts
public RuleSeverity GetSeverity()
{
return RuleSeverity.Warning;
}
public string GetSourceName()
{
return this.srcName;
}
public string GetFullModulePath()
{
return this.modPath;
}
#endregion
#region Constructors
public ExternalRule()
{
}
public ExternalRule(string name, string commonName, string desc, string param, string paramType, string srcName, string modPath)
{
this.name = name;
this.commonName = commonName;
this.desc = desc;
this.param = param;
this.srcName = srcName;
this.modPath = modPath;
this.paramType = paramType;
}
#endregion
}
}