Permalink
Browse files

refactored some stuff found by fxcop

  • Loading branch information...
1 parent 6aee091 commit a1104e797d963fd6f3813fd3e5a05fe2e867fccb @RubenWillems RubenWillems committed Nov 21, 2010
View
@@ -1,5 +1,5 @@
@echo off
cls
-Tools\NAnt\NAnt.exe -buildfile:ccnet.build -D:codemetrics.output.type=HtmlFile -nologo -logfile:nant-build.log.txt %*
+Tools\NAnt\NAnt.exe clean build -buildfile:ccnet.build -D:codemetrics.output.type=HtmlFile -nologo -logfile:nant-build.log.txt %*
echo %time% %date%
pause
@@ -1,9 +1,11 @@
using System.Reflection;
+using System.Runtime.InteropServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly : AssemblyTitle("CruiseControl.NET Multi-Project Tray Application")]
[assembly : AssemblyDescription("")]
-[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyConfiguration("")]
+[assembly: ComVisibleAttribute(false)]
@@ -1,9 +1,11 @@
using System.Reflection;
+using System.Runtime.InteropServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly : AssemblyTitle("CC.NET SysTray Watcher Lib")]
[assembly : AssemblyDescription("")]
-[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyConfiguration("")]
+[assembly: ComVisibleAttribute(false)]
@@ -4,7 +4,7 @@ namespace ThoughtWorks.CruiseControl.CCTrayLib.X10
{
public enum ControllerType { CM11, CM17A }
- public enum HouseCode { A=1, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P }
+ public enum HouseCode {A=1, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P }
[Flags]
public enum Function
@@ -1,5 +1,6 @@
using System.Reflection;
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
@@ -9,3 +10,4 @@
[assembly: AssemblyDescription("Adds additional functionality that is based in .NET 3.5.")]
[assembly: AssemblyConfiguration("")]
[assembly: InternalsVisibleTo("ThoughtWorks.CruiseControl.UnitTests")]
+[assembly: ComVisibleAttribute(false)]
@@ -1,9 +1,11 @@
using System.Reflection;
+using System.Runtime.InteropServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly : AssemblyTitle("CC.NET Remote Interface Library")]
[assembly : AssemblyDescription("")]
-[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyConfiguration("")]
+[assembly: ComVisibleAttribute(false)]
@@ -29,14 +29,14 @@ public abstract class ParameterBase
/// <summary>
/// Initialise a new instance of a <see cref="ParameterBase"/>.
/// </summary>
- public ParameterBase()
+ protected ParameterBase()
{
}
/// <summary>
/// Initialise an instance of a <see cref="ParameterBase"/> with a name.
/// </summary>
- public ParameterBase(string name)
+ protected ParameterBase(string name)
{
myName = name;
}
@@ -20,13 +20,13 @@ public abstract class AuditFilterBase
/// <summary>
/// Starts a new blank filter.
/// </summary>
- public AuditFilterBase() { }
+ protected AuditFilterBase() { }
/// <summary>
/// Starts a new filter with an inner filter.
/// </summary>
/// <param name="inner">The inner filter.</param>
- public AuditFilterBase(AuditFilterBase inner)
+ protected AuditFilterBase(AuditFilterBase inner)
{
this.innerFilter = inner;
}
@@ -1,4 +1,5 @@
using System.Reflection;
+using System.Runtime.InteropServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
@@ -54,3 +55,4 @@
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
+[assembly: ComVisibleAttribute(false)]
@@ -1,9 +1,11 @@
using System.Reflection;
+using System.Runtime.InteropServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly : AssemblyTitle("CC.NET Web Dashboard")]
[assembly : AssemblyDescription("")]
-[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyConfiguration("")]
+[assembly: ComVisibleAttribute(false)]
@@ -1,9 +1,11 @@
using System.Reflection;
+using System.Runtime.InteropServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly : AssemblyTitle("CC.NET Console Runner")]
[assembly : AssemblyDescription("")]
-[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyConfiguration("")]
+[assembly: ComVisibleAttribute(false)]
@@ -1,5 +1,6 @@
using System.Reflection;
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
@@ -9,3 +10,4 @@
[assembly : AssemblyDescription("")]
[assembly : AssemblyConfiguration("")]
[assembly: InternalsVisibleTo("ThoughtWorks.CruiseControl.UnitTests")]
+[assembly: ComVisibleAttribute(false)]
@@ -9,8 +9,8 @@ namespace ThoughtWorks.CruiseControl.Core.Config
[Serializable]
public class ConfigurationException : CruiseControlException
{
- public ConfigurationException(string s) : base(s) {}
- public ConfigurationException(string s, Exception e) : base(s, e) {}
+ public ConfigurationException(string message) : base(message) {}
+ public ConfigurationException(string message, Exception exception) : base(message, exception) {}
protected ConfigurationException(SerializationInfo info, StreamingContext context)
:base (info, context) {}
}
@@ -21,8 +21,8 @@ protected ConfigurationException(SerializationInfo info, StreamingContext contex
[Serializable]
public class ConfigurationFileMissingException : ConfigurationException
{
- public ConfigurationFileMissingException(string s) : base(s) {}
- public ConfigurationFileMissingException(string s, Exception e) : base(s, e) {}
+ public ConfigurationFileMissingException(string message) : base(message) {}
+ public ConfigurationFileMissingException(string message, Exception exception) : base(message, exception) {}
protected ConfigurationFileMissingException(SerializationInfo info, StreamingContext context)
: base(info, context) {}
}
@@ -103,9 +103,9 @@ public static string EvalToString(string statement)
return ( T ) Convert.ChangeType( EvalToObject( expression ), typeof ( T ) );
}
- public static string StringAsLiteral(string s)
+ public static string StringAsLiteral(string theString)
{
- var expression = new CodePrimitiveExpression( s );
+ var expression = new CodePrimitiveExpression( theString );
var sb = new StringBuilder();
var options = new CodeGeneratorOptions();
using ( TextWriter writer = new StringWriter( sb ) )
View
@@ -158,7 +158,7 @@
</Compile>
<Compile Include="Config\ConfigurationTrace.cs" />
<Compile Include="Config\ConfigurationValidationUtils.cs" />
- <Compile Include="Config\Preprocessor\CodeEvaluator.cs" />
+ <Compile Include="Config\Preprocessor\Evaluator.cs" />
<Compile Include="Config\Preprocessor\DebuggingWriter.cs" />
<Compile Include="Config\Preprocessor\ElementProcessors\ConditionalProcessor.cs" />
<Compile Include="Config\Preprocessor\ElementProcessors\ConfigTemplateProcessor.cs" />
@@ -253,9 +253,9 @@ private void SelectBranch()
}
}
- public bool HasChanges(ProcessInfo p)
+ public bool HasChanges(ProcessInfo processInfo)
{
- ProcessResult result = Execute(p);
+ ProcessResult result = Execute(processInfo);
return !result.StandardOutput.TrimEnd().EndsWith(NO_CHANGE);
}
@@ -3,6 +3,6 @@ namespace ThoughtWorks.CruiseControl.Core.Sourcecontrol
/// <title>Modification Filters</title>
public interface IModificationFilter
{
- bool Accept(Modification m);
+ bool Accept(Modification modification);
}
}
@@ -13,11 +13,11 @@ public abstract class ProcessSourceControl
protected IHistoryParser historyParser;
private Timeout timeout = Timeout.DefaultTimeout;
- public ProcessSourceControl(IHistoryParser historyParser) : this(historyParser, new ProcessExecutor())
+ protected ProcessSourceControl(IHistoryParser historyParser) : this(historyParser, new ProcessExecutor())
{
}
- public ProcessSourceControl(IHistoryParser historyParser, ProcessExecutor executor)
+ protected ProcessSourceControl(IHistoryParser historyParser, ProcessExecutor executor)
{
this.executor = executor;
this.historyParser = historyParser;
@@ -36,12 +36,12 @@ public static string FormatDate(DateTime date, IFormatProvider formatter)
/// <summary>
/// Returns the largest of the 2 passed dates
/// </summary>
- /// <param name="a"></param>
- /// <param name="b"></param>
+ /// <param name="dateOne"></param>
+ /// <param name="dateTwo"></param>
/// <returns></returns>
- public static DateTime MaxDate(DateTime a, DateTime b)
+ public static DateTime MaxDate(DateTime dateOne, DateTime dateTwo)
{
- return (a > b) ? a : b;
+ return (dateOne > dateTwo) ? dateOne : dateTwo;
}
/// <summary>
@@ -10,9 +10,9 @@ public class HtmlExceptionFormatter : IStringFormatter
{
private Exception _exception;
- public HtmlExceptionFormatter(Exception e)
+ public HtmlExceptionFormatter(Exception exception)
{
- this._exception = e;
+ this._exception = exception;
}
public override string ToString()
@@ -25,7 +25,7 @@ namespace ThoughtWorks.CruiseControl.Core.Util.Log4NetTrace
public interface ITraceLog : ILog
{
void Trace(object message);
- void Trace(object message, Exception t);
+ void Trace(object message, Exception exception);
void TraceFormat(string format, params object[] args);
bool IsTraceEnabled { get; }
}
@@ -65,9 +65,9 @@ public void Trace(object message)
Logger.Log(ThisDeclaringType, m_levelTrace, message, null);
}
- public void Trace(object message, System.Exception t)
+ public void Trace(object message, System.Exception exception)
{
- Logger.Log(ThisDeclaringType, m_levelTrace, message, t);
+ Logger.Log(ThisDeclaringType, m_levelTrace, message, exception);
}
public void TraceFormat(string format, params object[] args)
@@ -22,12 +22,12 @@ public class StringUtil
/// <summary>
/// Checks if the 2 strings are equal, ignoring casing
/// </summary>
- /// <param name="a"></param>
- /// <param name="b"></param>
+ /// <param name="stringOne"></param>
+ /// <param name="stringTwo"></param>
/// <returns></returns>
- public static bool EqualsIgnoreCase(string a, string b)
+ public static bool EqualsIgnoreCase(string stringOne, string stringTwo)
{
- return CaseInsensitiveComparer.Default.Compare(a, b) == 0;
+ return CaseInsensitiveComparer.Default.Compare(stringOne, stringTwo) == 0;
}
/// <summary>
@@ -148,9 +148,9 @@ public static string Join(string separator, params string[] strings)
return sb.ToString();
}
- public static string RemoveNulls(string s)
+ public static string RemoveNulls(string input)
{
- return NullStringRegex.Replace(s, string.Empty).TrimStart();
+ return NullStringRegex.Replace(input, string.Empty).TrimStart();
}
/// <summary>
@@ -307,13 +307,13 @@ public static string[] NewLineSeparatedStringToArray(string input)
/// <summary>
/// returns the elements of the array as a string, delimited with the default delimitor
/// </summary>
- /// <param name="x"></param>
+ /// <param name="array"></param>
/// <returns></returns>
- public static string GetArrayContents(Array x)
+ public static string GetArrayContents(Array array)
{
System.Text.StringBuilder result = new System.Text.StringBuilder();
- foreach (object o in x)
+ foreach (object o in array)
{
result.AppendFormat("{0}{1} ", o.ToString(), DEFAULT_DELIMITER);
}
@@ -35,12 +35,12 @@ public override string ToString()
return name;
}
- public static TimeUnits Parse(string s)
+ public static TimeUnits Parse(string input)
{
- string key = s.ToLower();
+ string key = input.ToLower();
if (!values.ContainsKey(key))
{
- throw new CruiseControlException(string.Format(System.Globalization.CultureInfo.CurrentCulture,"Invalid time units specified [{0}]. I understand {1}", s, makeString(values.Keys)));
+ throw new CruiseControlException(string.Format(System.Globalization.CultureInfo.CurrentCulture,"Invalid time units specified [{0}]. I understand {1}", input, MakeString(values.Keys)));
}
return (TimeUnits) values[key];
@@ -52,7 +52,7 @@ public int CompareTo(object obj)
return this.factor.CompareTo(other.factor);
}
- private static string makeString(ICollection c)
+ private static string MakeString(ICollection c)
{
StringBuilder sb = new StringBuilder();
ArrayList list = new ArrayList(c);
@@ -136,11 +136,11 @@ public static string EncodeCDATA(string text)
return CDataCloseTag.Replace(text, @"] ]>");
}
- public static string StringSerialize(object o)
+ public static string StringSerialize(object obj)
{
- XmlSerializer serializer = new XmlSerializer(o.GetType());
+ XmlSerializer serializer = new XmlSerializer(obj.GetType());
StringWriter writer1 = new StringWriter();
- serializer.Serialize(writer1, o);
+ serializer.Serialize(writer1, obj);
StringReader reader = new StringReader(writer1.ToString());
StringWriter writer2 = new StringWriter();
@@ -1,9 +1,11 @@
using System.Reflection;
+using System.Runtime.InteropServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly : AssemblyTitle("Objection Core")]
[assembly : AssemblyDescription("")]
-[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyConfiguration("")]
+[assembly: ComVisibleAttribute(false)]
@@ -1,4 +1,6 @@
using System.Reflection;
+using System.Runtime.InteropServices;
[assembly : AssemblyTitle("CC.NET Service Runner")]
-[assembly : AssemblyDescription("CC.NET Service Runner")]
+[assembly : AssemblyDescription("CC.NET Service Runner")]
+[assembly: ComVisibleAttribute(false)]

0 comments on commit a1104e7

Please sign in to comment.