Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactored some stuff found by fxcop

  • Loading branch information...
commit a1104e797d963fd6f3813fd3e5a05fe2e867fccb 1 parent 6aee091
RubenWillems RubenWillems authored
Showing with 70 additions and 50 deletions.
  1. +1 −1  build.bat
  2. +3 −1 project/CCTray/AssemblyInfo.cs
  3. +3 −1 project/CCTrayLib/AssemblyInfo.cs
  4. +1 −1  project/CCTrayLib/X10/X10Definitions.cs
  5. +2 −0  project/Core.Extensions/Properties/AssemblyInfo.cs
  6. +3 −1 project/Remote/AssemblyInfo.cs
  7. +2 −2 project/Remote/Parameters/ParameterBase.cs
  8. +2 −2 project/Remote/Security/AuditFilterBase.cs
  9. +2 −0  project/UnitTests/AssemblyInfo.cs
  10. +3 −1 project/WebDashboard/AssemblyInfo.cs
  11. +3 −1 project/console/AssemblyInfo.cs
  12. +2 −0  project/core/AssemblyInfo.cs
  13. +4 −4 project/core/Config/ConfigurationException.cs
  14. +2 −2 project/core/Config/preprocessor/{CodeEvaluator.cs → Evaluator.cs}
  15. +1 −1  project/core/core.csproj
  16. +2 −2 project/core/sourcecontrol/Alienbrain.cs
  17. +1 −1  project/core/sourcecontrol/IModificationFilter.cs
  18. +2 −2 project/core/sourcecontrol/ProcessSourceControl.cs
  19. +4 −4 project/core/util/DateUtil.cs
  20. +2 −2 project/core/util/HtmlExceptionFormatter.cs
  21. +1 −1  project/core/util/Log4NetTrace/ITraceLog.cs
  22. +2 −2 project/core/util/Log4NetTrace/TraceLogImpl.cs
  23. +9 −9 project/core/util/StringUtil.cs
  24. +4 −4 project/core/util/TimeUnits.cs
  25. +3 −3 project/core/util/XmlUtil.cs
  26. +3 −1 project/objection/AssemblyInfo.cs
  27. +3 −1 project/service/AssemblyInfo.cs
2  build.bat
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
4 project/CCTray/AssemblyInfo.cs
View
@@ -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
@@ -6,4 +7,5 @@
//
[assembly : AssemblyTitle("CruiseControl.NET Multi-Project Tray Application")]
[assembly : AssemblyDescription("")]
-[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyConfiguration("")]
+[assembly: ComVisibleAttribute(false)]
4 project/CCTrayLib/AssemblyInfo.cs
View
@@ -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
@@ -6,4 +7,5 @@
//
[assembly : AssemblyTitle("CC.NET SysTray Watcher Lib")]
[assembly : AssemblyDescription("")]
-[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyConfiguration("")]
+[assembly: ComVisibleAttribute(false)]
2  project/CCTrayLib/X10/X10Definitions.cs
View
@@ -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
2  project/Core.Extensions/Properties/AssemblyInfo.cs
View
@@ -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)]
4 project/Remote/AssemblyInfo.cs
View
@@ -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
@@ -6,4 +7,5 @@
//
[assembly : AssemblyTitle("CC.NET Remote Interface Library")]
[assembly : AssemblyDescription("")]
-[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyConfiguration("")]
+[assembly: ComVisibleAttribute(false)]
4 project/Remote/Parameters/ParameterBase.cs
View
@@ -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;
}
4 project/Remote/Security/AuditFilterBase.cs
View
@@ -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;
}
2  project/UnitTests/AssemblyInfo.cs
View
@@ -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)]
4 project/WebDashboard/AssemblyInfo.cs
View
@@ -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
@@ -6,4 +7,5 @@
//
[assembly : AssemblyTitle("CC.NET Web Dashboard")]
[assembly : AssemblyDescription("")]
-[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyConfiguration("")]
+[assembly: ComVisibleAttribute(false)]
4 project/console/AssemblyInfo.cs
View
@@ -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
@@ -6,4 +7,5 @@
//
[assembly : AssemblyTitle("CC.NET Console Runner")]
[assembly : AssemblyDescription("")]
-[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyConfiguration("")]
+[assembly: ComVisibleAttribute(false)]
2  project/core/AssemblyInfo.cs
View
@@ -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)]
8 project/core/Config/ConfigurationException.cs
View
@@ -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) {}
}
4 project/core/Config/preprocessor/CodeEvaluator.cs → project/core/Config/preprocessor/Evaluator.cs
View
@@ -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 ) )
2  project/core/core.csproj
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" />
4 project/core/sourcecontrol/Alienbrain.cs
View
@@ -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);
}
2  project/core/sourcecontrol/IModificationFilter.cs
View
@@ -3,6 +3,6 @@ namespace ThoughtWorks.CruiseControl.Core.Sourcecontrol
/// <title>Modification Filters</title>
public interface IModificationFilter
{
- bool Accept(Modification m);
+ bool Accept(Modification modification);
}
}
4 project/core/sourcecontrol/ProcessSourceControl.cs
View
@@ -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;
8 project/core/util/DateUtil.cs
View
@@ -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>
4 project/core/util/HtmlExceptionFormatter.cs
View
@@ -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()
2  project/core/util/Log4NetTrace/ITraceLog.cs
View
@@ -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; }
}
4 project/core/util/Log4NetTrace/TraceLogImpl.cs
View
@@ -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)
18 project/core/util/StringUtil.cs
View
@@ -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);
}
8 project/core/util/TimeUnits.cs
View
@@ -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);
6 project/core/util/XmlUtil.cs
View
@@ -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();
4 project/objection/AssemblyInfo.cs
View
@@ -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
@@ -6,4 +7,5 @@
//
[assembly : AssemblyTitle("Objection Core")]
[assembly : AssemblyDescription("")]
-[assembly : AssemblyConfiguration("")]
+[assembly : AssemblyConfiguration("")]
+[assembly: ComVisibleAttribute(false)]
4 project/service/AssemblyInfo.cs
View
@@ -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)]
Please sign in to comment.
Something went wrong with that request. Please try again.