Skip to content

Commit

Permalink
Bulk style changes
Browse files Browse the repository at this point in the history
Trying to reduce amount of warmings output by the build 5835 warnings reduced to 2559 warnings.
  • Loading branch information
atruskie committed Apr 8, 2020
1 parent f072e0f commit f2bb1e5
Show file tree
Hide file tree
Showing 492 changed files with 8,599 additions and 9,438 deletions.
4 changes: 2 additions & 2 deletions src/AcousticWorkbench/AcousticEventService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace AcousticWorkbench
{
using System.Linq;
using System.Threading.Tasks;
using Models;
using AcousticWorkbench.Models;

public class AcousticEventService : Service
{
Expand Down Expand Up @@ -41,4 +41,4 @@ public async Task<AudioEvent> GetAudioEvent(long audioEventId)
return audioEvents.Single();
}
}
}
}
6 changes: 3 additions & 3 deletions src/AcousticWorkbench/AcousticWorkbenchResponse{T}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ namespace AcousticWorkbench
using Newtonsoft.Json.Linq;

// [JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
// public abstract class RubyJsonObject
// {
// }
// public abstract class RubyJsonObject
// {
// }

public class AcousticWorkbenchResponse<T>
{
Expand Down
4 changes: 2 additions & 2 deletions src/AcousticWorkbench/AudioRecordingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace AcousticWorkbench
{
using System.Threading.Tasks;
using Models;
using AcousticWorkbench.Models;

public class AudioRecordingService : Service
{
Expand All @@ -23,4 +23,4 @@ public async Task<AudioRecording> GetAudioRecording(long audioRecordingId)
return await this.ProcessApiResult<AudioRecording>(response);
}
}
}
}
2 changes: 1 addition & 1 deletion src/AcousticWorkbench/IApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ public interface IApi

//string Uri { get; }
}
}
}
2 changes: 1 addition & 1 deletion src/AcousticWorkbench/IAuthenticatedApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public interface IAuthenticatedApi : IApi

string Token { get; }
}
}
}
4 changes: 2 additions & 2 deletions src/AcousticWorkbench/MediaService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace AcousticWorkbench
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
using Models;
using AcousticWorkbench.Models;

public partial class MediaService : Service
{
Expand Down Expand Up @@ -71,4 +71,4 @@ public async Task<Media> GetMetaData(long audioRecordingId)
throw new InvalidOperationException("DownloadMedia reached an invalid state");
}
}
}
}
2 changes: 1 addition & 1 deletion src/AcousticWorkbench/Models/Models.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="Models.cs" company="QutEcoacoustics">
// <copyright file="Models.cs" company="QutEcoacoustics">
// All code in this file and all associated files are the copyright and property of the QUT Ecoacoustics Research Group (formerly MQUTeR, and formerly QUT Bioacoustics Research Group).
// </copyright>

Expand Down
4 changes: 2 additions & 2 deletions src/AcousticWorkbench/UrlGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="UrlGenerator.cs" company="QutEcoacoustics">
// <copyright file="UrlGenerator.cs" company="QutEcoacoustics">
// All code in this file and all associated files are the copyright and property of the QUT Ecoacoustics Research Group (formerly MQUTeR, and formerly QUT Bioacoustics Research Group).
// </copyright>

Expand Down Expand Up @@ -86,4 +86,4 @@ public static Uri ViewBase(this IApi api, string path = "")
return new Uri($"{api.Protocol}://{api.Host}{path}");
}
}
}
}
2 changes: 1 addition & 1 deletion src/Acoustics.Shared/AnalysisIo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ internal AnalysisIoInputDirectory((IFileSystem FileSystem, IDirectoryInfo Base)

public new DirectoryInfo InputBase => new DirectoryInfo(base.InputBase.FullName);
}
}
}
2 changes: 1 addition & 1 deletion src/Acoustics.Shared/AppConfigHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,4 +344,4 @@ private static void CheckForExecutePermissionInternal(string executablePath)
}
}
}
}
}
4 changes: 2 additions & 2 deletions src/Acoustics.Shared/Base58.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="Base58.cs" company="QutEcoacoustics">
// <copyright file="Base58.cs" company="QutEcoacoustics">
// All code in this file and all associated files are the copyright and property of the QUT Ecoacoustics Research Group (formerly MQUTeR, and formerly QUT Bioacoustics Research Group).
// </copyright>

Expand Down Expand Up @@ -77,4 +77,4 @@ public static long Decode(string link)
return result;
}
}
}
}
2 changes: 1 addition & 1 deletion src/Acoustics.Shared/Binary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ public static T Deserialize<T>(FileInfo source)
}
}
}
}
}
50 changes: 25 additions & 25 deletions src/Acoustics.Shared/CalcSunTimes.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CalcSunTimes.cs" company="QutEcoacoustics">
// All code in this file and all associated files are the copyright and property of the QUT Ecoacoustics Research Group (formerly MQUTeR, and formerly QUT Bioacoustics Research Group).
// </copyright>
Expand Down Expand Up @@ -43,13 +43,13 @@ private SunTimes()

public abstract class Coords
{
protected internal int mDegrees = 0;
protected internal int mMinutes = 0;
protected internal int mSeconds = 0;
protected internal int MDegrees = 0;
protected internal int MMinutes = 0;
protected internal int MSeconds = 0;

public double ToDouble()
{
return this.Sign() * (this.mDegrees + ((double)this.mMinutes / 60) + ((double)this.mSeconds / 3600));
return this.Sign() * (this.MDegrees + ((double)this.MMinutes / 60) + ((double)this.MSeconds / 3600));
}

protected internal abstract int Sign();
Expand All @@ -63,19 +63,19 @@ public enum Direction
South,
}

protected internal Direction mDirection = Direction.North;
protected internal Direction MDirection = Direction.North;

public LatitudeCoords(int degrees, int minutes, int seconds, Direction direction)
{
this.mDegrees = degrees;
this.mMinutes = minutes;
this.mSeconds = seconds;
this.mDirection = direction;
this.MDegrees = degrees;
this.MMinutes = minutes;
this.MSeconds = seconds;
this.MDirection = direction;
}

protected internal override int Sign()
{
return this.mDirection == Direction.North ? 1 : -1;
return this.MDirection == Direction.North ? 1 : -1;
}
}

Expand All @@ -87,19 +87,19 @@ public enum Direction
West,
}

protected internal Direction mDirection = Direction.East;
protected internal Direction MDirection = Direction.East;

public LongitudeCoords(int degrees, int minutes, int seconds, Direction direction)
{
this.mDegrees = degrees;
this.mMinutes = minutes;
this.mSeconds = seconds;
this.mDirection = direction;
this.MDegrees = degrees;
this.MMinutes = minutes;
this.MSeconds = seconds;
this.MDirection = direction;
}

protected internal override int Sign()
{
return this.mDirection == Direction.East ? 1 : -1;
return this.MDirection == Direction.East ? 1 : -1;
}
}

Expand All @@ -109,10 +109,10 @@ protected internal override int Sign()
/// <param name="lat">Latitude coordinates.</param>
/// <param name="lon">Longitude coordinates.</param>
/// <param name="date">Date for which to calculate.</param>
/// <param name="riseTime">Sunrise time (output)</param>
/// <param name="setTime">Sunset time (output)</param>
/// <param name="isSunrise">Whether or not the sun rises at that day</param>
/// <param name="isSunset">Whether or not the sun sets at that day</param>
/// <param name="riseTime">Sunrise time (output).</param>
/// <param name="setTime">Sunset time (output).</param>
/// <param name="isSunrise">Whether or not the sun rises at that day.</param>
/// <param name="isSunset">Whether or not the sun sets at that day.</param>
public bool CalculateSunRiseSetTimes(LatitudeCoords lat, LongitudeCoords lon, DateTime date,
ref DateTime riseTime, ref DateTime setTime,
ref bool isSunrise, ref bool isSunset)
Expand All @@ -126,10 +126,10 @@ public bool CalculateSunRiseSetTimes(LatitudeCoords lat, LongitudeCoords lon, Da
/// <param name="lat">Latitude in decimal notation.</param>
/// <param name="lon">Longitude in decimal notation.</param>
/// <param name="date">Date for which to calculate.</param>
/// <param name="riseTime">Sunrise time (output)</param>
/// <param name="setTime">Sunset time (output)</param>
/// <param name="isSunrise">Whether or not the sun rises at that day</param>
/// <param name="isSunset">Whether or not the sun sets at that day</param>
/// <param name="riseTime">Sunrise time (output).</param>
/// <param name="setTime">Sunset time (output).</param>
/// <param name="isSunrise">Whether or not the sun rises at that day.</param>
/// <param name="isSunset">Whether or not the sun sets at that day.</param>
public bool CalculateSunRiseSetTimes(double lat, double lon, DateTime date,
ref DateTime riseTime, ref DateTime setTime,
ref bool isSunrise, ref bool isSunset)
Expand Down
4 changes: 2 additions & 2 deletions src/Acoustics.Shared/ColorScales/ColorBrewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public enum Type
[SuppressMessage("ReSharper", "StringLiteralTypo", Justification = "Hex color codes causing false positives")]
public static partial class ColorBrewer
{
public static QualitativePalettes Qualitative { get; } = new QualitativePalettes();
public static QualitativePalettes Qualitative { get; } = new QualitativePalettes();

public static SequentialSingleHuePalettes SequentialSingleHue { get; } = new SequentialSingleHuePalettes();

public static DivergingPalettes Diverging { get; } = new DivergingPalettes();

public static SequentialMultipleHuesPalettes SequentialMultipleHues { get; } = new SequentialMultipleHuesPalettes();
}
}
}
8 changes: 4 additions & 4 deletions src/Acoustics.Shared/ConfigFile/ConfigFile.Deserialize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@ internal static void FlushCache()
/// </summary>
/// <remarks>
/// Support exists for processing recursive config file (where a <see cref="Config"/> objected is nested in another
/// <see cref="Config"/>
/// <see cref="Config"/>.
/// </remarks>
/// <typeparam name="T">The type to deserialize</typeparam>
/// <typeparam name="T">The type to deserialize.</typeparam>
/// <param name="path">
/// The path to the config file to read (will be expanded with <see cref="Path.GetFullPath"/>
/// The path to the config file to read (will be expanded with <see cref="Path.GetFullPath"/>.
/// </param>
/// <param name="factory">
/// A factory used to create a new config if <typeparamref name="T"/> is exactly the type <see cref="Config"/>.
/// </param>
/// <returns>The config object, or a cached copy after the first call</returns>
/// <returns>The config object, or a cached copy after the first call.</returns>
private static T LoadAndCache<T>(string path, Func<T> factory)
where T : IConfig
{
Expand Down
2 changes: 1 addition & 1 deletion src/Acoustics.Shared/ConfigFile/INamedProfiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ public interface INamedProfiles<T>
/// </summary>
Dictionary<string, T> Profiles { get; }
}
}
}
42 changes: 20 additions & 22 deletions src/Acoustics.Shared/Contracts/Contract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ namespace Acoustics.Shared.Contracts
{
using System;
using System.Diagnostics;
using System.IO;
using Acoustics.Shared.ConfigFile;
using JetBrains.Annotations;

/// <summary>
Expand All @@ -20,9 +18,9 @@ public static class Contract
/// <summary>
/// Require the supplied value to be not null, otherwise throw a argument null exception.
/// </summary>
/// <param name="value">Whether or not the exception should be thrown</param>
/// <param name="name">The name of the argument that was null</param>
/// <param name="message">The message to add to the exception if the check fails</param>
/// <param name="value">Whether or not the exception should be thrown.</param>
/// <param name="name">The name of the argument that was null.</param>
/// <param name="message">The message to add to the exception if the check fails.</param>
[DebuggerHidden]
[ContractAnnotation("value:null => halt")]
public static void RequiresNotNull(object value, string name = "", string message = "Precondition failed - value was null")
Expand All @@ -36,9 +34,9 @@ public static void RequiresNotNull(object value, string name = "", string messag
/// <summary>
/// Ensures the supplied value to be not null, otherwise throw a argument null exception.
/// </summary>
/// <param name="value">Whether or not the exception should be thrown</param>
/// <param name="name">The name of the argument that was null</param>
/// <param name="message">The message to add to the exception if the check fails</param>
/// <param name="value">Whether or not the exception should be thrown.</param>
/// <param name="name">The name of the argument that was null.</param>
/// <param name="message">The message to add to the exception if the check fails.</param>
[DebuggerHidden]
[ContractAnnotation("value:null => halt")]
public static void EnsuresNotNull(object value, string name = "", string message = "Postcondition failed - value was null")
Expand All @@ -52,9 +50,9 @@ public static void EnsuresNotNull(object value, string name = "", string message
/// <summary>
/// Require the supplied boolean to be true, otherwise throw an exception.
/// </summary>
/// <typeparam name="T">The type of exception to throw</typeparam>
/// <param name="result">Whether or not the exception should be thrown</param>
/// <param name="message">The message to add to the exception if the check fails</param>
/// <typeparam name="T">The type of exception to throw.</typeparam>
/// <param name="result">Whether or not the exception should be thrown.</param>
/// <param name="message">The message to add to the exception if the check fails.</param>
[DebuggerHidden]
[ContractAnnotation("result:false => halt")]
public static void Requires<T>(bool result, string message = "Precondition failed")
Expand All @@ -69,9 +67,9 @@ public static void Requires<T>(bool result, string message = "Precondition faile
/// <summary>
/// Require the supplied boolean to be true, otherwise throw an exception.
/// </summary>
/// <typeparam name="T">The type of exception to throw</typeparam>
/// <param name="result">Whether or not the exception should be thrown</param>
/// <param name="args">The arguments to supply to the exception's constructor</param>
/// <typeparam name="T">The type of exception to throw.</typeparam>
/// <param name="result">Whether or not the exception should be thrown.</param>
/// <param name="args">The arguments to supply to the exception's constructor.</param>
[DebuggerHidden]
[ContractAnnotation("result:false => halt")]
public static void Requires<T>(bool result, params object[] args)
Expand All @@ -93,9 +91,9 @@ public static void Requires<T>(bool result, params object[] args)
/// This is a mirror of <see cref="Requires{T}(bool,string)"/> and behaves identically.
/// If you wish to check a condition at the end of your method, move the <see cref="Ensures{T}"/> call there.
/// </summary>
/// <typeparam name="T">The type of exception to throw</typeparam>
/// <param name="result">Whether or not the exception should be thrown</param>
/// <param name="message">The message to add to the exception if the check fails</param>
/// <typeparam name="T">The type of exception to throw.</typeparam>
/// <param name="result">Whether or not the exception should be thrown.</param>
/// <param name="message">The message to add to the exception if the check fails.</param>
[DebuggerHidden]
[ContractAnnotation("result:false => halt")]
public static void Ensures<T>(bool result, string message = "Precondition failed")
Expand All @@ -110,8 +108,8 @@ public static void Ensures<T>(bool result, string message = "Precondition failed
/// <summary>
/// Require the supplied boolean to be true, otherwise throw an <see cref="ArgumentException"/>.
/// </summary>
/// <param name="result">Whether or not the exception should be thrown</param>
/// <param name="message">The message to add to the exception if the check fails</param>
/// <param name="result">Whether or not the exception should be thrown.</param>
/// <param name="message">The message to add to the exception if the check fails.</param>
[DebuggerHidden]
[ContractAnnotation("result:false => halt")]
public static void Requires(bool result, string message = "Precondition failed")
Expand All @@ -127,8 +125,8 @@ public static void Requires(bool result, string message = "Precondition failed")
/// This is a mirror of <see cref="Requires"/> and behaves identically.
/// If you wish to check a condition at the end of your method, move the <see cref="Ensures"/> call there.
/// </summary>
/// <param name="result">Whether or not the exception should be thrown</param>
/// <param name="message">The message to add to the exception if the check fails</param>
/// <param name="result">Whether or not the exception should be thrown.</param>
/// <param name="message">The message to add to the exception if the check fails.</param>
[DebuggerHidden]
[ContractAnnotation("result:false => halt")]
public static void Ensures(bool result, string message = "Precondition failed")
Expand All @@ -139,4 +137,4 @@ public static void Ensures(bool result, string message = "Precondition failed")
}
}
}
}
}
Loading

0 comments on commit f2bb1e5

Please sign in to comment.