Author: spouliot
Date: 2008-02-12 09:35:39 -0500 (Tue, 12 Feb 2008)
New Revision: 95504
Added:
trunk/mono-tools/gendarme/framework/Gendarme.Framework/Confidence.cs
trunk/mono-tools/gendarme/framework/Gendarme.Framework/Defect.cs
trunk/mono-tools/gendarme/framework/Gendarme.Framework/IAssemblyRule.cs
trunk/mono-tools/gendarme/framework/Gendarme.Framework/IMethodRule.cs
trunk/mono-tools/gendarme/framework/Gendarme.Framework/IRule.cs
trunk/mono-tools/gendarme/framework/Gendarme.Framework/IRunner.cs
trunk/mono-tools/gendarme/framework/Gendarme.Framework/ITypeRule.cs
trunk/mono-tools/gendarme/framework/Gendarme.Framework/MinimalRunner.cs
trunk/mono-tools/gendarme/framework/Gendarme.Framework/Rule.cs
trunk/mono-tools/gendarme/framework/Gendarme.Framework/RuleResult.cs
trunk/mono-tools/gendarme/framework/Gendarme.Framework/Runner.cs
trunk/mono-tools/gendarme/framework/Gendarme.Framework/RunnerEventArgs.cs
trunk/mono-tools/gendarme/framework/Gendarme.Framework/Severity.cs
Modified:
trunk/mono-tools/gendarme/framework/Gendarme.Framework/ChangeLog
Log:
New files for the next version of the framework. Work in progress.
Modified: trunk/mono-tools/gendarme/framework/Gendarme.Framework/ChangeLog
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/ChangeLog
2008-02-12 14:33:37 UTC (rev 95503)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/ChangeLog
2008-02-12 14:35:39 UTC (rev 95504)
@@ -1,3 +1,10 @@
+2008-02-12 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * Confidence.cs, Defect.cs, IAssemblyRule.cs, IMethodRule.cs,
+ IRule.cs, IRunner.cs, ITypeRule.cs, MinimalRunner.cs, Rule.cs,
+ RuleResult.cs, Runner.cs, RunnerEventArgs.cs, Severity.cs: New files
+ for the next version of the framework. Work in progress.
+
2008-01-30 Sebastien Pouliot <[EMAIL PROTECTED]>
* StackEntryAnalysis.cs: Shared class to analyse the stack by
Added: trunk/mono-tools/gendarme/framework/Gendarme.Framework/Confidence.cs
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/Confidence.cs
2008-02-12 14:33:37 UTC (rev 95503)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/Confidence.cs
2008-02-12 14:35:39 UTC (rev 95504)
@@ -0,0 +1,57 @@
+//
+// Gendarme.Framework.Confidence
+//
+// Authors:
+// Sebastien Pouliot <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// 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.
+
+using System;
+
+namespace Gendarme.Framework {
+
+ /// <summary>
+ /// The level of confidence about the rule results. The more
+ /// confidence the less likely the rule will return false positives.
+ /// </summary>
+ public enum Confidence {
+ /// <summary>
+ /// The rule is 100% certain of its result.
+ /// There should never be false positives for Total.
+ /// </summary>
+ Total,
+ /// <summary>
+ /// The rule is near 100% certain of its result.
+ /// A few false-positives are possible.
+ /// </summary>
+ High,
+ /// <summary>
+ /// The rule has found a potential defect but cannot be certain
of the result.
+ /// Some false positive are to be expected in the results.
+ /// </summary>
+ Normal,
+ /// <summary>
+ /// The rule doesn't have enough information to be certain
about the defect.
+ /// Many of the results are false positives.
+ /// </summary>
+ Low
+ }
+}
Added: trunk/mono-tools/gendarme/framework/Gendarme.Framework/Defect.cs
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/Defect.cs
2008-02-12 14:33:37 UTC (rev 95503)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/Defect.cs
2008-02-12 14:35:39 UTC (rev 95504)
@@ -0,0 +1,157 @@
+//
+// Gendarme.Framework.Defect
+//
+// Authors:
+// Sebastien Pouliot <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// 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.
+
+using System;
+using System.Text;
+
+using Mono.Cecil;
+using Mono.Cecil.Cil;
+
+namespace Gendarme.Framework {
+
+ // implementation of Defect classes must be immutable
+ abstract public class Defect {
+
+ IRule rule;
+ string text;
+
+ protected Defect (IRule rule, string text)
+ {
+ this.rule = rule;
+ this.text = text;
+ }
+
+ public IRule Rule {
+ get { return rule; }
+ }
+
+ public string Text {
+ get { return text; }
+ }
+
+ abstract public AssemblyDefinition Assembly { get; }
+
+ abstract public Confidence Confidence { get; }
+
+ abstract public string Location { get; }
+
+ abstract public Severity Severity { get; }
+
+ abstract public object Target { get; }
+ }
+
+ public class Defect<T> : Defect {
+
+ private T location;
+ private Severity severity;
+ private Confidence confidence;
+ private Instruction ins;
+
+ public Defect (IRule rule, T location, Severity severity,
Confidence confidence, string text)
+ : base (rule, text)
+ {
+ this.location = location;
+ this.confidence = confidence;
+ this.severity = severity;
+ }
+
+ public Defect (IRule rule, T location, Instruction ins,
Severity severity, Confidence confidence, string text)
+ : this (rule, location, severity, confidence, text)
+ {
+ // this ctor is usable only for MethodDefinition
+ if (!(location is MethodDefinition))
+ throw new ArgumentException ("location");
+ this.ins = ins;
+ }
+
+ public override AssemblyDefinition Assembly {
+ get {
+ AssemblyDefinition ad = (location as
AssemblyDefinition);
+ if (ad != null)
+ return ad;
+
+ /*ModuleDefinition md = (location as
ModuleDefinition);
+ if (md != null)
+ return md.Assembly;*/
+
+ TypeDefinition td = (location as
TypeDefinition);
+ if (td != null)
+ return td.Module.Assembly;
+
+ MethodDefinition md = (location as
MethodDefinition);
+ if (md != null)
+ return md.DeclaringType.Module.Assembly;
+
+ FieldDefinition fd = (location as
FieldDefinition);
+ if (fd != null)
+ return fd.DeclaringType.Module.Assembly;
+
+ ParameterDefinition pd = (location as
ParameterDefinition);
+ if (pd != null)
+ return
pd.Method.DeclaringType.Module.Assembly;
+
+ return null;
+ }
+ }
+
+ public override Confidence Confidence {
+ get { return confidence; }
+ }
+
+ public override string Location {
+ get {
+ if (ins == null)
+ return Assembly.Name.FullName;
+
+ MethodDefinition method = (location as
MethodDefinition);
+ StringBuilder sb = new StringBuilder ();
+
+ // try to find to most
+ Instruction search = ins;
+ while (search != null) {
+ if (search.SequencePoint != null) {
+ sb.AppendFormat
("{0}({1},{2})", search.SequencePoint.Document.Url,
+
search.SequencePoint.StartLine, search.SequencePoint.StartColumn);
+ return sb.ToString ();
+ }
+ search = search.Previous;
+ }
+
+ sb.Append (method.ToString ());
+ sb.AppendFormat (":(0x{0:x4})", ins.Offset);
+ return sb.ToString ();
+ }
+ }
+
+ public override Severity Severity {
+ get { return severity; }
+ }
+
+ public override object Target {
+ get { return location; }
+ }
+ }
+}
Added: trunk/mono-tools/gendarme/framework/Gendarme.Framework/IAssemblyRule.cs
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/IAssemblyRule.cs
2008-02-12 14:33:37 UTC (rev 95503)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/IAssemblyRule.cs
2008-02-12 14:35:39 UTC (rev 95504)
@@ -0,0 +1,36 @@
+//
+// Gendarme.Framework.IAssemblyRule interface
+//
+// Authors:
+// Sebastien Pouliot <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// 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.
+
+using System;
+
+using Mono.Cecil;
+
+namespace Gendarme.Framework {
+
+ public interface IAssemblyRule : IRule {
+ RuleResult CheckAssembly (AssemblyDefinition assembly);
+ }
+}
Added: trunk/mono-tools/gendarme/framework/Gendarme.Framework/IMethodRule.cs
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/IMethodRule.cs
2008-02-12 14:33:37 UTC (rev 95503)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/IMethodRule.cs
2008-02-12 14:35:39 UTC (rev 95504)
@@ -0,0 +1,36 @@
+//
+// Gendarme.Framework.IMethodRule interface
+//
+// Authors:
+// Sebastien Pouliot <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// 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.
+
+using System;
+
+using Mono.Cecil;
+
+namespace Gendarme.Framework {
+
+ public interface IMethodRule : IRule {
+ RuleResult CheckMethod (MethodDefinition method);
+ }
+}
Added: trunk/mono-tools/gendarme/framework/Gendarme.Framework/IRule.cs
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/IRule.cs
2008-02-12 14:33:37 UTC (rev 95503)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/IRule.cs
2008-02-12 14:35:39 UTC (rev 95504)
@@ -0,0 +1,77 @@
+//
+// Gendarme.Framework.IRule interface
+//
+// Authors:
+// Sebastien Pouliot <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// 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.
+
+using System;
+
+namespace Gendarme.Framework {
+
+ /// <summary>
+ /// Most basic way to manipulate a rule. To create a new rule you
should consider
+ /// to inherit from Rule and implement IAssemblyRule, ITypeRule and/or
IMethodRule.
+ /// </summary>
+ public interface IRule {
+
+ /// <summary>
+ /// Turn on or off the rule. The runner won't call a Check*
method on rules
+ /// where Active is false. This is useful when used with the
runner's events
+ /// to turn off a rule if we know it's useless (e.g. for an
assembly).
+ /// </summary>
+ bool Active { get; set; }
+
+ /// <summary>
+ /// Return the instance of the current runner.
+ /// </summary>
+ IRunner Runner { get; }
+
+ /// <summary>
+ /// Unique name for the rule.
+ /// </summary>
+ string Name { get; }
+
+ /// <summary>
+ /// URI to the rule documentation.
+ /// </summary>
+ Uri Uri { get; }
+
+ /// <summary>
+ /// Short abstract of the problem that the rule is looking for.
+ /// For a complete description end-users should read the
documentation URI.
+ /// </summary>
+ string Problem { get; }
+
+ /// <summary>
+ /// Short abstract of the solution to this problem. For a
complete solution
+ /// with examples (both good and bad) end-users should read the
documentation URI.
+ /// </summary>
+ string Solution { get; }
+
+ /// <summary>
+ /// The runner will initialize each rule before starting
analyzing any assembly.
+ /// </summary>
+ /// <param name="runner">Runner that will execute the rule
during analysis.</param>
+ void Initialize (IRunner runner);
+ }
+}
Added: trunk/mono-tools/gendarme/framework/Gendarme.Framework/IRunner.cs
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/IRunner.cs
2008-02-12 14:33:37 UTC (rev 95503)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/IRunner.cs
2008-02-12 14:35:39 UTC (rev 95504)
@@ -0,0 +1,74 @@
+//
+// Gendarme.Framework.IRuner interface
+//
+// Authors:
+// Sebastien Pouliot <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// 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.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Runtime.InteropServices;
+
+using Mono.Cecil;
+using Mono.Cecil.Cil;
+
+namespace Gendarme.Framework {
+
+ // rules will have access to the runner thru this interface
+ // so anyone can make it's own runner without using the provided base
class
+ public interface IRunner {
+
+ // we should expose the list of assemblies, so rules can act on
them
+ // as "a set". E.g. checking for inheritance, smells ...
+
+ // we should expose the list of rules, so rules can also act on
them
+ // E.g. Rule X is a superset of rule Y so Y disable itself is X
is present
+
+ Collection<IRule> Rules { get; }
+ Dictionary<string, AssemblyDefinition> Assemblies { get; }
+ Collection<Defect> Defects { get; }
+ int VerbosityLevel { get; }
+
+ event EventHandler<RunnerEventArgs> AnalyzeAssembly; // ???
ProcessAssembly ???
+ event EventHandler<RunnerEventArgs> AnalyzeModule;
+ event EventHandler<RunnerEventArgs> AnalyzeType;
+ event EventHandler<RunnerEventArgs> AnalyzeMethod;
+
+ void Initialize ();
+
+ void Report (Defect defect);
+
+ [ComVisible (false)]
+ void Report (IRule rule, AssemblyDefinition assembly, Severity
severity, Confidence confidence, string message);
+ [ComVisible (false)]
+ void Report (IRule rule, TypeDefinition type, Severity
severity, Confidence confidence, string message);
+ [ComVisible (false)]
+ void Report (IRule rule, FieldDefinition field, Severity
severity, Confidence confidence, string message);
+ [ComVisible (false)]
+ void Report (IRule rule, MethodDefinition method, Severity
severity, Confidence confidence, string message);
+ [ComVisible (false)]
+ void Report (IRule rule, MethodDefinition method, Instruction
ins, Severity severity, Confidence confidence, string message);
+ [ComVisible (false)]
+ void Report (IRule rule, ParameterDefinition parameter,
Severity severity, Confidence confidence, string message);
+ }
+}
Added: trunk/mono-tools/gendarme/framework/Gendarme.Framework/ITypeRule.cs
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/ITypeRule.cs
2008-02-12 14:33:37 UTC (rev 95503)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/ITypeRule.cs
2008-02-12 14:35:39 UTC (rev 95504)
@@ -0,0 +1,36 @@
+//
+// Gendarme.Framework.ITypeRule interface
+//
+// Authors:
+// Sebastien Pouliot <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// 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.
+
+using System;
+
+using Mono.Cecil;
+
+namespace Gendarme.Framework {
+
+ public interface ITypeRule : IRule {
+ RuleResult CheckType (TypeDefinition type);
+ }
+}
Added: trunk/mono-tools/gendarme/framework/Gendarme.Framework/MinimalRunner.cs
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/MinimalRunner.cs
2008-02-12 14:33:37 UTC (rev 95503)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/MinimalRunner.cs
2008-02-12 14:35:39 UTC (rev 95504)
@@ -0,0 +1,31 @@
+//
+// Gendarme.Framework.MinimalRunner
+//
+// Authors:
+// Aaron Tomb <[EMAIL PROTECTED]>
+//
+// Copyright (c) 2005 Aaron Tomb
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// 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 Gendarme.Framework {
+
+ public class MinimalRunner : Runner {
+ }
+}
Added: trunk/mono-tools/gendarme/framework/Gendarme.Framework/Rule.cs
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/Rule.cs
2008-02-12 14:33:37 UTC (rev 95503)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/Rule.cs
2008-02-12 14:35:39 UTC (rev 95504)
@@ -0,0 +1,102 @@
+//
+// Gendarme.Framework.Rule base class
+//
+// Authors:
+// Sebastien Pouliot <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// 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.
+
+using System;
+
+namespace Gendarme.Framework {
+
+ /// <summary>
+ /// Most rules should be able to inherit from Rule and implement one of
the
+ /// <c>IAssemblyRule</c>, <c>ITypeRule</c> or <c>IMethodRule</c> and
override
+ /// the Check[Assembly|Type|Method] method.
+ /// </summary>
+ abstract public class Rule : IRule {
+
+ private IRunner runner;
+ private string rule_name;
+ private string rule_url;
+
+ /// <summary>
+ /// Return true if the rule is currently active, false
otherwise.
+ /// </summary>
+ public virtual bool Active {
+ get { return true; }
+ set { ; }
+ }
+
+ /// <summary>
+ /// Return the runner executing the rule. This is helpful to
get information
+ /// outside the rule, like the list of assemblies being
analyzed.
+ /// </summary>
+ public IRunner Runner {
+ get { return runner; }
+ }
+
+ /// <summary>
+ /// Return the name of the rule.
+ /// By default this returns the name of the current class.
+ /// </summary>
+ public virtual string Name {
+ get {
+ if (rule_name == null)
+ rule_name = GetType ().Name;
+ return rule_name;
+ }
+ }
+
+ public abstract string Problem { get; }
+
+ public abstract string Solution { get; }
+
+ /// <summary>
+ /// Return an Uri instance to the rule documentation.
+ /// By default this returns:
+ /// http://www.mono-project.com/{rule name space}#{rule name}
+ /// </summary>
+ public virtual Uri Uri {
+ get {
+ if (rule_url == null) {
+ Type t = GetType ();
+ rule_name = t.Name;
+ rule_url = String.Format
("http://www.mono-project.com/{0}#{1}", t.Namespace, rule_name);
+ }
+ // note: we return a new copy since Uri is not
immutable
+ return new Uri (rule_url);
+ }
+ }
+
+ /// <summary>
+ /// Initialize the rule. This is where rule can do it's heavy
initialization
+ /// since the assemblies to be analyzed are already known (and
accessible thru
+ /// the runner parameter).
+ /// </summary>
+ /// <param name="runner">The runner that will execute this
rule.</param>
+ public virtual void Initialize (IRunner runner)
+ {
+ this.runner = runner;
+ }
+ }
+}
Added: trunk/mono-tools/gendarme/framework/Gendarme.Framework/RuleResult.cs
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/RuleResult.cs
2008-02-12 14:33:37 UTC (rev 95503)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/RuleResult.cs
2008-02-12 14:35:39 UTC (rev 95504)
@@ -0,0 +1,54 @@
+//
+// Gendarme.Framework.RuleResult enumeration
+//
+// Authors:
+// Sebastien Pouliot <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// 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.
+
+using System;
+
+namespace Gendarme.Framework {
+
+ public enum RuleResult {
+ /// <summary>
+ /// Rules returns this if the required conditions to execute
+ /// are not matched. This is useful to make rules more
+ /// readable (it's not a real success) and for statistics.
+ /// </summary>
+ DoesNotApply,
+ /// <summary>
+ /// Rules returns this if it has executed its logic and has
+ /// not found any defect.
+ /// </summary>
+ Success,
+ /// <summary>
+ /// Rules returns this if it has executed its logic and has
+ /// found one or more defects.
+ /// </summary>
+ Failure,
+ /// <summary>
+ /// Rules should never report this. The framework will use
+ /// this value to track errors in rule execution.
+ /// </summary>
+ Abort
+ }
+}
Added: trunk/mono-tools/gendarme/framework/Gendarme.Framework/Runner.cs
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/Runner.cs
2008-02-12 14:33:37 UTC (rev 95503)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/Runner.cs
2008-02-12 14:35:39 UTC (rev 95504)
@@ -0,0 +1,303 @@
+//
+// Gendarme.Framework.Runner
+//
+// Authors:
+// Sebastien Pouliot <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// 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.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+
+using Mono.Cecil;
+using Mono.Cecil.Cil;
+
+namespace Gendarme.Framework {
+
+ abstract public class Runner : IRunner {
+
+ Dictionary<IRule, string> ignore_list = new Dictionary <IRule,
string> ();
+ Collection<Defect> defect_list = new Collection<Defect> ();
+
+ Collection<IRule> rules = new Collection<IRule> ();
+ Dictionary<string, AssemblyDefinition> assemblies = new
Dictionary<string, AssemblyDefinition> ();
+ private int verbose_level;
+
+ public event EventHandler<RunnerEventArgs> AnalyzeAssembly;
// ??? ProcessAssembly ???
+ public event EventHandler<RunnerEventArgs> AnalyzeModule;
+ public event EventHandler<RunnerEventArgs> AnalyzeType;
+ public event EventHandler<RunnerEventArgs> AnalyzeMethod;
+
+ public Collection<IRule> Rules {
+ get { return rules; }
+ }
+
+ public Dictionary<string,AssemblyDefinition> Assemblies {
+ get { return assemblies; }
+ }
+
+ public Collection<Defect> Defects {
+ get { return defect_list; }
+ }
+
+ public int VerbosityLevel {
+ get { return verbose_level; }
+ set { verbose_level = value; }
+ }
+
+
+ // once every assembly are loaded *and* all the rules are known
-> we initialized all rules.
+ // this ensure that the list of assemblies is available at rule
initialization time
+ // which allows caching information and treating the assemblies
as "a set"
+ public void Initialize ()
+ {
+ foreach (AssemblyDefinition assembly in
assemblies.Values) {
+ try {
+ assembly.MainModule.LoadSymbols ();
+ }
+ catch (COMException) {
+ // this happens if a PDB is missing
+ }
+ }
+
+ foreach (Rule rule in rules) {
+ try {
+ rule.Initialize (this);
+ }
+ catch (Exception e) {
+ // if something goes wrong in
initialization we desactivate the rule
+ if (VerbosityLevel > 0)
+ Console.WriteLine (e);
+ rule.Active = false;
+ }
+ }
+ }
+
+ public bool IsIgnored (IRule rule, AssemblyDefinition assembly)
+ {
+ if ((rule == null) || !rule.Active)
+ return true;
+ if (assembly == null)
+ throw new ArgumentNullException ("assembly");
+
+ return false; // (ignore_list.Contains (rule,
method.ToString ()));
+ }
+
+ public bool IsIgnored (IRule rule, TypeDefinition type)
+ {
+ if ((rule == null) || !rule.Active)
+ return true;
+ if (type == null)
+ throw new ArgumentNullException ("type");
+
+ // check for type itself (full match)
+ // otherwise check for assembly
+ return IsIgnored (rule, type.Module.Assembly);
+ }
+
+ public bool IsIgnored (IRule rule, MethodDefinition method)
+ {
+ if ((rule == null) || !rule.Active)
+ return true;
+ if (method == null)
+ throw new ArgumentNullException ("method");
+
+ // check for method itself (full match)
+ // otherwise check for its type
+ return IsIgnored (rule, (method.DeclaringType as
TypeDefinition));
+ }
+
+ public void Report (Defect defect)
+ {
+ if (defect == null)
+ throw new ArgumentNullException ("defect");
+
+ defect_list.Add (defect);
+ }
+
+ public void Report (IRule rule, AssemblyDefinition assembly,
Severity severity, Confidence confidence, string message)
+ {
+ defect_list.Add (new Defect<AssemblyDefinition> (rule,
assembly, severity, confidence, message));
+ }
+
+ public void Report (IRule rule, TypeDefinition type, Severity
severity, Confidence confidence, string message)
+ {
+ defect_list.Add (new Defect<TypeDefinition> (rule,
type, severity, confidence, message));
+ }
+
+ public void Report (IRule rule, FieldDefinition field, Severity
severity, Confidence confidence, string message)
+ {
+ defect_list.Add (new Defect<FieldDefinition> (rule,
field, severity, confidence, message));
+ }
+
+ public void Report (IRule rule, MethodDefinition method,
Severity severity, Confidence confidence, string message)
+ {
+ defect_list.Add (new Defect<MethodDefinition> (rule,
method, severity, confidence, message));
+ }
+
+ public void Report (IRule rule, MethodDefinition method,
Instruction ins, Severity severity, Confidence confidence, string message)
+ {
+ defect_list.Add (new Defect<MethodDefinition> (rule,
method, ins, severity, confidence, message));
+ }
+
+ public void Report (IRule rule, ParameterDefinition parameter,
Severity severity, Confidence confidence, string message)
+ {
+ defect_list.Add (new Defect<ParameterDefinition> (rule,
parameter, severity, confidence, message));
+ }
+
+
+ private void OnEvent (EventHandler<RunnerEventArgs> handler,
RunnerEventArgs e)
+ {
+ if (handler != null)
+ handler (this, e);
+ }
+
+ // protected since a higher-level (e.g. GUI) runner might want
to override
+ // them to update it's user interface
+ protected virtual void OnAssembly (RunnerEventArgs e)
+ {
+ OnEvent (AnalyzeAssembly, e);
+ }
+
+ protected virtual void OnModule (RunnerEventArgs e)
+ {
+ OnEvent (AnalyzeModule, e);
+ }
+
+ protected virtual void OnType (RunnerEventArgs e)
+ {
+ OnEvent (AnalyzeType, e);
+ }
+
+ protected virtual void OnMethod (RunnerEventArgs e)
+ {
+ OnEvent (AnalyzeMethod, e);
+ }
+/*
+ private void ProcessAssemblies (RunnerEventArgs args)
+ {
+ foreach (AssemblyDefinition assembly in assemblies) {
+ args.CurrentAssembly = assembly;
+ OnAssembly (args);
+
+ foreach (IAssemblyRule rule in rules) {
+ if (IsIgnored (rule, assembly.ToString
()))
+ continue;
+ rule.CheckAssembly (assembly);
+ }
+
+ ProcessModules (args);
+ }
+ }
+
+ private void ProcessModules (RunnerEventArgs args)
+ {
+ foreach (ModuleDefinition module in
args.CurrentAssembly.Modules) {
+ args.CurrentModule = module;
+ OnModule (args);
+
+ // Note: we don't support IModuleRule in this
version
+ // nor do we ignore on modules
+
+ ProcessTypes (args);
+ }
+ }
+
+ private void ProcessTypes (RunnerEventArgs args)
+ {
+ foreach (TypeDefinition type in
args.CurrentModule.Types) {
+ args.CurrentType = type;
+ OnType (args);
+
+ ProcessMethods (args);
+ }
+ }
+
+ private void ProcessTypes (RunnerEventArgs args)
+ {
+ }
+*/
+ public void Run ()
+ {
+ RunnerEventArgs runner_args = new RunnerEventArgs
(this);
+
+ IEnumerable<IAssemblyRule> assembly_rules =
rules.OfType<IAssemblyRule> ();
+ IEnumerable<ITypeRule> type_rules =
rules.OfType<ITypeRule> ();
+ IEnumerable<IMethodRule> method_rules =
rules.OfType<IMethodRule> ();
+
+ foreach (AssemblyDefinition assembly in
assemblies.Values) {
+ runner_args.CurrentAssembly = assembly;
+ OnAssembly (runner_args);
+
+ foreach (IAssemblyRule rule in assembly_rules) {
+ if (IsIgnored (rule, assembly))
+ continue;
+ rule.CheckAssembly (assembly);
+ }
+
+ foreach (ModuleDefinition module in
assembly.Modules) {
+ runner_args.CurrentModule = module;
+ OnModule (runner_args);
+
+ // Since it has not been used in the
previous years this version
+ // doesn't support IModuleRule nor do
we ignore on modules
+
+ foreach (TypeDefinition type in
module.Types) {
+ runner_args.CurrentType = type;
+ OnType (runner_args);
+
+ foreach (ITypeRule rule in
type_rules) {
+ if (IsIgnored (rule,
type))
+ continue;
+ rule.CheckType (type);
+ }
+
+ foreach (MethodDefinition
constructor in type.Constructors) {
+
runner_args.CurrentMethod = constructor;
+ OnMethod (runner_args);
+
+ foreach (IMethodRule
rule in method_rules) {
+ if (IsIgnored
(rule, constructor))
+
continue;
+
rule.CheckMethod (constructor);
+ }
+ }
+
+ foreach (MethodDefinition
method in type.Methods) {
+
runner_args.CurrentMethod = method;
+ OnMethod (runner_args);
+
+ foreach (IMethodRule
rule in method_rules) {
+ if (IsIgnored
(rule, method))
+
continue;
+
rule.CheckMethod (method);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
Added: trunk/mono-tools/gendarme/framework/Gendarme.Framework/RunnerEventArgs.cs
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/RunnerEventArgs.cs
2008-02-12 14:33:37 UTC (rev 95503)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/RunnerEventArgs.cs
2008-02-12 14:35:39 UTC (rev 95504)
@@ -0,0 +1,89 @@
+//
+// Gendarme.Framework.RunnerEventArgs
+//
+// Authors:
+// Sebastien Pouliot <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// 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.
+
+
+using System;
+
+using Mono.Cecil;
+
+namespace Gendarme.Framework {
+
+ public class RunnerEventArgs : EventArgs {
+
+ private IRunner runner;
+ private AssemblyDefinition assembly;
+ private ModuleDefinition module;
+ private TypeDefinition type;
+ private MethodDefinition method;
+
+ public RunnerEventArgs (IRunner runner)
+ {
+ this.runner = runner;
+ }
+
+ public IRunner Runner {
+ get { return runner; }
+ }
+
+ public AssemblyDefinition CurrentAssembly {
+ get { return assembly; }
+ set {
+ if (value != assembly) {
+ assembly = value;
+ module = null;
+ type = null;
+ method = null;
+ }
+ }
+ }
+
+ public ModuleDefinition CurrentModule {
+ get { return module; }
+ set {
+ if (value != module) {
+ module = value;
+ type = null;
+ method = null;
+ }
+ }
+ }
+
+ public TypeDefinition CurrentType {
+ get { return type; }
+ set {
+ if (value != type) {
+ type = value;
+ method = null;
+ }
+ }
+ }
+
+ public MethodDefinition CurrentMethod {
+ get { return method; }
+ set { method = value; }
+ }
+ }
+}
Added: trunk/mono-tools/gendarme/framework/Gendarme.Framework/Severity.cs
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/Severity.cs
2008-02-12 14:33:37 UTC (rev 95503)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/Severity.cs
2008-02-12 14:35:39 UTC (rev 95504)
@@ -0,0 +1,52 @@
+//
+// Gendarme.Framework.Severity
+//
+// Authors:
+// Sebastien Pouliot <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// 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.
+
+using System;
+
+namespace Gendarme.Framework {
+
+ /// <summary>
+ /// How severe is a defect found by the rule.
+ /// </summary>
+ public enum Severity {
+ /// <summary>
+ /// The code can not work as expected.
+ /// </summary>
+ Critical,
+ /// <summary>
+ /// The code may work or fails depending on values,
configuration...
+ /// </summary>
+ High,
+ /// <summary>
+ /// The code will work most of the time or on the default, or
most, common configuration
+ /// </summary>
+ Medium,
+ /// <summary>
+ /// The actual code works, fixing the defect doesn't have a big
impact.
+ /// </summary>
+ Low
+ }
+}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches