diff --git a/src/Umbraco.Core/Configuration/GlobalSettings.cs b/src/Umbraco.Core/Configuration/GlobalSettings.cs index 2ac8e7d2ac..7b209a15cd 100644 --- a/src/Umbraco.Core/Configuration/GlobalSettings.cs +++ b/src/Umbraco.Core/Configuration/GlobalSettings.cs @@ -32,7 +32,6 @@ namespace Umbraco.Core.Configuration #region Private static fields - private static Version _version; private static readonly object Locker = new object(); //make this volatile so that we can ensure thread safety with a double check lock private static volatile string _reservedUrlsCache; diff --git a/src/Umbraco.Core/Persistence/PetaPoco.cs b/src/Umbraco.Core/Persistence/PetaPoco.cs index 735691f6d6..ae0044035d 100644 --- a/src/Umbraco.Core/Persistence/PetaPoco.cs +++ b/src/Umbraco.Core/Persistence/PetaPoco.cs @@ -337,7 +337,7 @@ namespace Umbraco.Core.Persistence _transaction = _sharedConnection.BeginTransaction(isolationLevel); } - catch (Exception e) + catch (Exception) { throw; } diff --git a/src/Umbraco.Core/PluginManager.cs b/src/Umbraco.Core/PluginManager.cs index 44d505d1d2..ceb9b2d7d1 100644 --- a/src/Umbraco.Core/PluginManager.cs +++ b/src/Umbraco.Core/PluginManager.cs @@ -343,7 +343,7 @@ namespace Umbraco.Core { return ReadCache(); } - catch (Exception ex) + catch (Exception) { try { @@ -519,7 +519,7 @@ namespace Umbraco.Core { return new FileStream(path, fileMode, fileAccess, fileShare); } - catch (Exception ex) + catch (Exception) { if (--attempts == 0) throw; diff --git a/src/Umbraco.Core/Security/MachineKeyGenerator.cs b/src/Umbraco.Core/Security/MachineKeyGenerator.cs index 9dd06f44bd..546429b72c 100644 --- a/src/Umbraco.Core/Security/MachineKeyGenerator.cs +++ b/src/Umbraco.Core/Security/MachineKeyGenerator.cs @@ -26,8 +26,6 @@ namespace Umbraco.Core.Security validation=""HMACSHA256"" decryption=""AES"" />"; - var Xxx = 3; - return string.Format(c, GenerateAESDecryptionKey(), GenerateHMACSHA256ValidationKey()); } @@ -83,4 +81,4 @@ namespace Umbraco.Core.Security return sb.ToString(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/UserService.cs b/src/Umbraco.Core/Services/UserService.cs index 9b52af6827..0e15eb6cc1 100644 --- a/src/Umbraco.Core/Services/UserService.cs +++ b/src/Umbraco.Core/Services/UserService.cs @@ -207,7 +207,7 @@ namespace Umbraco.Core.Services { return repository.GetByUsername(username, includeSecurityData: true); } - catch (DbException ex) + catch (DbException) { //we need to handle this one specific case which is when we are upgrading to 7.7 since the user group //tables don't exist yet. This is the 'easiest' way to deal with this without having to create special @@ -786,7 +786,7 @@ namespace Umbraco.Core.Services var result = repository.Get(id); return result; } - catch (DbException ex) + catch (DbException) { //we need to handle this one specific case which is when we are upgrading to 7.7 since the user group //tables don't exist yet. This is the 'easiest' way to deal with this without having to create special diff --git a/src/Umbraco.Core/StringExtensions.cs b/src/Umbraco.Core/StringExtensions.cs index ce9ac77712..d2a1d97709 100644 --- a/src/Umbraco.Core/StringExtensions.cs +++ b/src/Umbraco.Core/StringExtensions.cs @@ -164,7 +164,7 @@ namespace Umbraco.Core var obj = JsonConvert.DeserializeObject(input); return obj; } - catch (Exception ex) + catch (Exception) { return input; } @@ -622,7 +622,7 @@ namespace Umbraco.Core byte[] decodedBytes = UrlTokenDecode(input); return decodedBytes != null ? Encoding.UTF8.GetString(decodedBytes) : null; } - catch (FormatException ex) + catch (FormatException) { return null; } diff --git a/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs b/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs index f74a8c0a59..a9d24d00c5 100644 --- a/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs +++ b/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs @@ -26,7 +26,6 @@ namespace Umbraco.Core.Strings [Obsolete("Use the other ctor that specifies all dependencies")] public DefaultShortStringHelper() { - _umbracoSettings = _umbracoSettings; InitializeLegacyUrlReplaceCharacters(); } diff --git a/src/Umbraco.Tests/CodeFirst/ContentTypeMapper.cs b/src/Umbraco.Tests/CodeFirst/ContentTypeMapper.cs index 149eb19080..8caf215678 100644 --- a/src/Umbraco.Tests/CodeFirst/ContentTypeMapper.cs +++ b/src/Umbraco.Tests/CodeFirst/ContentTypeMapper.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using Umbraco.Core; using Umbraco.Core.Models; namespace Umbraco.Tests.CodeFirst @@ -32,7 +31,7 @@ namespace Umbraco.Tests.CodeFirst value = DateTime.Parse(property.Value.ToString()); else if (propertyInfo.PropertyType == typeof(Boolean)) { - if (String.IsNullOrEmpty(property.Value.ToString()) || property.Value == "0") + if (String.IsNullOrEmpty(property.Value.ToString()) || (string)property.Value == "0") { value = false; } @@ -48,4 +47,4 @@ namespace Umbraco.Tests.CodeFirst return mapped; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs b/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs index bf5100815f..3f85ecab0f 100644 --- a/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs +++ b/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs @@ -419,7 +419,6 @@ namespace Umbraco.Tests.CoreXml { var source = new TestSource5(); var nav = new NavigableNavigator(source); - TestContent content; Assert.AreEqual(NavigableNavigator.StatePosition.Root, nav.InternalState.Position); Assert.IsTrue(nav.MoveToFirstChild()); @@ -1162,4 +1161,4 @@ namespace Umbraco.Tests.CoreXml } #endregion -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/DelegateExtensionsTests.cs b/src/Umbraco.Tests/DelegateExtensionsTests.cs index 511440c2c7..e745e029d0 100644 --- a/src/Umbraco.Tests/DelegateExtensionsTests.cs +++ b/src/Umbraco.Tests/DelegateExtensionsTests.cs @@ -26,7 +26,6 @@ namespace Umbraco.Tests [Test] public void Quits_On_Success_Count() { - var maxTries = 5; var totalTries = 0; DelegateExtensions.RetryUntilSuccessOrMaxAttempts((currentTry) => { @@ -43,4 +42,4 @@ namespace Umbraco.Tests } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/Collections/Item.cs b/src/Umbraco.Tests/Models/Collections/Item.cs index ff1789a850..f20648fd41 100644 --- a/src/Umbraco.Tests/Models/Collections/Item.cs +++ b/src/Umbraco.Tests/Models/Collections/Item.cs @@ -12,7 +12,6 @@ namespace Umbraco.Tests.Models.Collections public abstract class Item : IEntity, ICanBeDirty { private bool _hasIdentity; - private int? _hash; private int _id; private Guid _key; @@ -173,15 +172,7 @@ namespace Umbraco.Tests.Models.Collections public static bool operator ==(Item left, Item right) { - /*if (ReferenceEquals(null, left)) - return false; - - if(ReferenceEquals(null, right)) - return false;*/ - return ReferenceEquals(left, right); - - return left.Equals(right); } public static bool operator !=(Item left, Item right) @@ -250,4 +241,4 @@ namespace Umbraco.Tests.Models.Collections return this.MemberwiseClone(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs index db7fcb815a..5ec34ea781 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs @@ -935,7 +935,6 @@ namespace Umbraco.Tests.PublishedContent { // the converter args PublishedPropertyType argPropertyType = null; - object argSource = null; bool argPreview = false; var pt1 = new PublishedPropertyType("legend", 0, Constants.PropertyEditors.TextboxAlias); diff --git a/src/Umbraco.Tests/Scheduling/BackgroundTaskRunnerTests.cs b/src/Umbraco.Tests/Scheduling/BackgroundTaskRunnerTests.cs index dee8a26743..0712056a30 100644 --- a/src/Umbraco.Tests/Scheduling/BackgroundTaskRunnerTests.cs +++ b/src/Umbraco.Tests/Scheduling/BackgroundTaskRunnerTests.cs @@ -943,8 +943,6 @@ namespace Umbraco.Tests.Scheduling throw new NotImplementedException(); } - private int i; - public async Task RunAsync(CancellationToken token) { Console.WriteLine("boom"); diff --git a/src/Umbraco.Web.UI/umbraco/developer/Packages/DirectoryBrowser.aspx.cs b/src/Umbraco.Web.UI/umbraco/developer/Packages/DirectoryBrowser.aspx.cs index c2995b6793..cd71ece0db 100644 --- a/src/Umbraco.Web.UI/umbraco/developer/Packages/DirectoryBrowser.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/developer/Packages/DirectoryBrowser.aspx.cs @@ -95,7 +95,7 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Packages { _sb.Append("