Skip to content

Commit

Permalink
Enable SA1128
Browse files Browse the repository at this point in the history
References #23
  • Loading branch information
andreashuber-lawo committed May 2, 2016
1 parent 35f425e commit abe501e
Show file tree
Hide file tree
Showing 37 changed files with 111 additions and 66 deletions.
1 change: 0 additions & 1 deletion CodeAnalysis.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@
<Rule Id="SA1615" Action="None" />
<Rule Id="SA1637" Action="None" />
<Rule Id="SA1649" Action="None" />
<Rule Id="SA1128" Action="None" />
<Rule Id="SA1611" Action="None" />
<Rule Id="SA1648" Action="None" />
<Rule Id="SA1204" Action="None" />
Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/Ember/EmberConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public sealed class EmberConverter : IEmberConverter
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// <summary>Initializes a new instance of the <see cref="EmberConverter"/> class.</summary>
public EmberConverter() : this(new EmberTypeBag())
public EmberConverter()
: this(new EmberTypeBag())
{
}

Expand Down
9 changes: 6 additions & 3 deletions Lawo.EmberPlusSharp/Ember/EmberException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,20 @@ namespace Lawo.EmberPlusSharp.Ember
public sealed class EmberException : Exception
{
/// <summary>Initializes a new instance of the <see cref="EmberException"/> class.</summary>
public EmberException() : this(null)
public EmberException()
: this(null)
{
}

/// <summary>Initializes a new instance of the <see cref="EmberException"/> class.</summary>
public EmberException(string message) : this(message, null)
public EmberException(string message)
: this(message, null)
{
}

/// <summary>Initializes a new instance of the <see cref="EmberException"/> class.</summary>
public EmberException(string message, Exception innerException) : base(message, innerException)
public EmberException(string message, Exception innerException)
: base(message, innerException)
{
}
}
Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/Ember/EmberReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public sealed class EmberReader : IDisposable

/// <summary>Initializes a new instance of the <see cref="EmberReader"/> class by calling
/// <see cref="EmberReader(Stream, int)">EmberReader(<paramref name="stream"/>, 1024)</see>.</summary>
public EmberReader(Stream stream) : this(stream, Constants.MemoryStreamBufferSize)
public EmberReader(Stream stream)
: this(stream, Constants.MemoryStreamBufferSize)
{
}

Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/Ember/EmberWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public sealed class EmberWriter : IDisposable

/// <summary>Initializes a new instance of the <see cref="EmberWriter"/> class by calling
/// <see cref="EmberWriter(Stream, int)">EmberWriter(<paramref name="stream"/>, 1024)</see>.</summary>
public EmberWriter(Stream stream) : this(stream, Constants.MemoryStreamBufferSize)
public EmberWriter(Stream stream)
: this(stream, Constants.MemoryStreamBufferSize)
{
}

Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/Ember/FieldPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public override string ToString()

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

internal FieldPath(Field<TTypeId, TFieldId> field) : this(null, null, field)
internal FieldPath(Field<TTypeId, TFieldId> field)
: this(null, null, field)
{
}

Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/Model/DynamicFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ internal sealed class DynamicFunction : FunctionBase<DynamicFunction>

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

internal DynamicFunction() : base(EmptyDescription, EmptyDescription)
internal DynamicFunction()
: base(EmptyDescription, EmptyDescription)
{
}

Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/Model/InvocationFailedException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public IResult Result

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

internal InvocationFailedException(string message, IResult result) : base(message)
internal InvocationFailedException(string message, IResult result)
: base(message)
{
this.result = result;
}
Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/Model/Matrix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ internal sealed override void WriteChanges(EmberWriter writer, IInvocationCollec

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

private Matrix() : base(RetrievalState.Complete)
private Matrix()
: base(RetrievalState.Complete)
{
}
}
Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/Model/MetaElement1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ private sealed class MetaElement<TProperty> : MetaElement

////////////////////////////////////////////////////////////////////////////////////////////////////////////

internal MetaElement(PropertyInfo property) : base(property)
internal MetaElement(PropertyInfo property)
: base(property)
{
var objParam = Expression.Parameter(typeof(TMostDerived));
this.get = Expression.Lambda<Func<TMostDerived, TProperty>>(
Expand Down
9 changes: 6 additions & 3 deletions Lawo.EmberPlusSharp/Model/ModelException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,20 @@ namespace Lawo.EmberPlusSharp.Model
public sealed class ModelException : Exception
{
/// <summary>Initializes a new instance of the <see cref="ModelException"/> class.</summary>
public ModelException() : this(null)
public ModelException()
: this(null)
{
}

/// <summary>Initializes a new instance of the <see cref="ModelException"/> class.</summary>
public ModelException(string message) : this(message, null)
public ModelException(string message)
: this(message, null)
{
}

/// <summary>Initializes a new instance of the <see cref="ModelException"/> class.</summary>
public ModelException(string message, Exception innerException) : base(message, innerException)
public ModelException(string message, Exception innerException)
: base(message, innerException)
{
}
}
Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/Model/NodeBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ void IParent.OnPropertyChanged(PropertyChangedEventArgs e)
this.OnPropertyChanged(e);
}

internal NodeBase() : base(RetrievalState.None)
internal NodeBase()
: base(RetrievalState.None)
{
}

Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/Model/ParameterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ void IStreamedParameter.SetProviderValue(object value)
this.SetProviderValue(this.AssertValueType(value));
}

internal ParameterBase() : base(RetrievalState.Complete)
internal ParameterBase()
: base(RetrievalState.Complete)
{
}

Expand Down
6 changes: 4 additions & 2 deletions Lawo.EmberPlusSharp/Model/Result1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public sealed class Result<T1> : ResultBase<Result<T1>>
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// <summary>Initializes a new instance of the <see cref="Result{T1}"/> class.</summary>
public Result() : this(new ValueReader<T1>())
public Result()
: this(new ValueReader<T1>())
{
}

Expand All @@ -28,7 +29,8 @@ public T1 Item1

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

private Result(ValueReader<T1> item1Reader) : base(item1Reader)
private Result(ValueReader<T1> item1Reader)
: base(item1Reader)
{
this.component1Reader = item1Reader;
}
Expand Down
6 changes: 4 additions & 2 deletions Lawo.EmberPlusSharp/Model/Result2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public sealed class Result<T1, T2> : ResultBase<Result<T1, T2>>
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// <summary>Initializes a new instance of the <see cref="Result{T1,T2}"/> class.</summary>
public Result() : this(new ValueReader<T1>(), new ValueReader<T2>())
public Result()
: this(new ValueReader<T1>(), new ValueReader<T2>())
{
}

Expand All @@ -36,7 +37,8 @@ public T2 Item2

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

private Result(ValueReader<T1> item1Reader, ValueReader<T2> item2Reader) : base(item1Reader, item2Reader)
private Result(ValueReader<T1> item1Reader, ValueReader<T2> item2Reader)
: base(item1Reader, item2Reader)
{
this.component1Reader = item1Reader;
this.component2Reader = item2Reader;
Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/Model/Result3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public sealed class Result<T1, T2, T3> : ResultBase<Result<T1, T2, T3>>
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// <summary>Initializes a new instance of the <see cref="Result{T1,T2,T3}"/> class.</summary>
public Result() : this(new ValueReader<T1>(), new ValueReader<T2>(), new ValueReader<T3>())
public Result()
: this(new ValueReader<T1>(), new ValueReader<T2>(), new ValueReader<T3>())
{
}

Expand Down
4 changes: 2 additions & 2 deletions Lawo.EmberPlusSharp/Model/Result4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public sealed class Result<T1, T2, T3, T4> : ResultBase<Result<T1, T2, T3, T4>>
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// <summary>Initializes a new instance of the <see cref="Result{T1,T2,T3,T4}"/> class.</summary>
public Result() : this(
new ValueReader<T1>(), new ValueReader<T2>(), new ValueReader<T3>(), new ValueReader<T4>())
public Result()
: this(new ValueReader<T1>(), new ValueReader<T2>(), new ValueReader<T3>(), new ValueReader<T4>())
{
}

Expand Down
13 changes: 7 additions & 6 deletions Lawo.EmberPlusSharp/Model/Result5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ public sealed class Result<T1, T2, T3, T4, T5> : ResultBase<Result<T1, T2, T3, T
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// <summary>Initializes a new instance of the <see cref="Result{T1,T2,T3,T4,T5}"/> class.</summary>
public Result() : this(
new ValueReader<T1>(),
new ValueReader<T2>(),
new ValueReader<T3>(),
new ValueReader<T4>(),
new ValueReader<T5>())
public Result()
: this(
new ValueReader<T1>(),
new ValueReader<T2>(),
new ValueReader<T3>(),
new ValueReader<T4>(),
new ValueReader<T5>())
{
}

Expand Down
15 changes: 8 additions & 7 deletions Lawo.EmberPlusSharp/Model/Result6.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ public sealed class Result<T1, T2, T3, T4, T5, T6> : ResultBase<Result<T1, T2, T
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// <summary>Initializes a new instance of the <see cref="Result{T1,T2,T3,T4,T5,T6}"/> class.</summary>
public Result() : this(
new ValueReader<T1>(),
new ValueReader<T2>(),
new ValueReader<T3>(),
new ValueReader<T4>(),
new ValueReader<T5>(),
new ValueReader<T6>())
public Result()
: this(
new ValueReader<T1>(),
new ValueReader<T2>(),
new ValueReader<T3>(),
new ValueReader<T4>(),
new ValueReader<T5>(),
new ValueReader<T6>())
{
}

Expand Down
7 changes: 4 additions & 3 deletions Lawo.EmberPlusSharp/Model/StaticFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ public abstract class StaticFunction<TMostDerived> : FunctionBase<TMostDerived>

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

internal StaticFunction() : base(
(KeyValuePair<string, ParameterType>[])ArgumentsTemplate.Clone(),
(KeyValuePair<string, ParameterType>[])ResultTemplate.Clone())
internal StaticFunction()
: base(
(KeyValuePair<string, ParameterType>[])ArgumentsTemplate.Clone(),
(KeyValuePair<string, ParameterType>[])ResultTemplate.Clone())
{
}

Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/S101/DeframingStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public sealed override async Task<int> ReadAsync(
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// <summary>Initializes a new instance of the <see cref="DeframingStream"/> class.</summary>
internal DeframingStream(ReadBuffer readBuffer, Action<byte> outOfFrameByteReceived) : base(readBuffer, null)
internal DeframingStream(ReadBuffer readBuffer, Action<byte> outOfFrameByteReceived)
: base(readBuffer, null)
{
this.outOfFrameByteReceived = outOfFrameByteReceived;
}
Expand Down
6 changes: 4 additions & 2 deletions Lawo.EmberPlusSharp/S101/EmberData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public sealed class EmberData : S101Command

/// <summary>Initializes a new instance of the <see cref="EmberData"/> class.</summary>
[SuppressMessage("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", Justification = "Official EmBER name.")]
public EmberData(byte dtd, params byte[] applicationBytes) : this()
public EmberData(byte dtd, params byte[] applicationBytes)
: this()
{
this.dtd = dtd;
this.applicationBytes = applicationBytes;
Expand Down Expand Up @@ -56,7 +57,8 @@ public sealed override string ToString()

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

internal EmberData() : base(CommandType.EmberData)
internal EmberData()
: base(CommandType.EmberData)
{
}

Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/S101/EventInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public struct EventInfo

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

internal EventInfo(DateTime? timeUtc) : this(timeUtc, null)
internal EventInfo(DateTime? timeUtc)
: this(timeUtc, null)
{
}

Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/S101/FramingStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ internal static async Task<FramingStream> CreateAsync(

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

private FramingStream(WriteBuffer writeBuffer) : base(null, writeBuffer)
private FramingStream(WriteBuffer writeBuffer)
: base(null, writeBuffer)
{
writeBuffer[writeBuffer.Count++] = Frame.BeginOfFrame;
}
Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/S101/KeepAliveRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ namespace Lawo.EmberPlusSharp.S101
public sealed class KeepAliveRequest : S101Command
{
/// <summary>Initializes a new instance of the <see cref="KeepAliveRequest"/> class.</summary>
public KeepAliveRequest() : base(CommandType.KeepAliveRequest)
public KeepAliveRequest()
: base(CommandType.KeepAliveRequest)
{
}
}
Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/S101/KeepAliveResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ namespace Lawo.EmberPlusSharp.S101
public sealed class KeepAliveResponse : S101Command
{
/// <summary>Initializes a new instance of the <see cref="KeepAliveResponse"/> class.</summary>
public KeepAliveResponse() : base(CommandType.KeepAliveResponse)
public KeepAliveResponse()
: base(CommandType.KeepAliveResponse)
{
}
}
Expand Down
9 changes: 6 additions & 3 deletions Lawo.EmberPlusSharp/S101/S101Exception.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,20 @@ namespace Lawo.EmberPlusSharp.S101
public sealed class S101Exception : Exception
{
/// <summary>Initializes a new instance of the <see cref="S101Exception"/> class.</summary>
public S101Exception() : this(null)
public S101Exception()
: this(null)
{
}

/// <summary>Initializes a new instance of the <see cref="S101Exception"/> class.</summary>
public S101Exception(string message) : this(message, null)
public S101Exception(string message)
: this(message, null)
{
}

/// <summary>Initializes a new instance of the <see cref="S101Exception"/> class.</summary>
public S101Exception(string message, Exception innerException) : base(message, innerException)
public S101Exception(string message, Exception innerException)
: base(message, innerException)
{
}
}
Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/S101/S101Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public S101Logger(EmberTypeBag types, TextWriter logWriter, XmlWriterSettings se
/// <param name="xmlLogWriter">The <see cref="XmlWriter"/> to write log messages to.</param>
/// <exception cref="ArgumentNullException"><paramref name="types"/> and/or <paramref name="xmlLogWriter"/>
/// equal <c>null</c>.</exception>
public S101Logger(EmberTypeBag types, XmlWriter xmlLogWriter) : this(new EmberConverter(types), xmlLogWriter)
public S101Logger(EmberTypeBag types, XmlWriter xmlLogWriter)
: this(new EmberConverter(types), xmlLogWriter)
{
}

Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/S101/S101Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public sealed class S101Message

/// <summary>Initializes a new instance of the <see cref="S101Message"/> class.</summary>
/// <exception cref="ArgumentNullException"><paramref name="command"/> equals <c>null</c>.</exception>
public S101Message(byte slot, S101Command command) : this(slot, S101.MessageType.Ember, command)
public S101Message(byte slot, S101Command command)
: this(slot, S101.MessageType.Ember, command)
{
if (command == null)
{
Expand Down
3 changes: 2 additions & 1 deletion Lawo.EmberPlusSharp/S101/S101Reader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public sealed class S101Reader
/// <see cref="S101Reader(ReadAsyncCallback, int)">S101Reader(<paramref name="readAsync"/>, 8192)</see>.
/// </summary>
[CLSCompliant(false)]
public S101Reader(ReadAsyncCallback readAsync) : this(readAsync, Constants.PhysicalStreamBufferSize)
public S101Reader(ReadAsyncCallback readAsync)
: this(readAsync, Constants.PhysicalStreamBufferSize)
{
}

Expand Down
Loading

0 comments on commit abe501e

Please sign in to comment.