From 6f0fd74ac96aaa9187a2f534d950de39fc666ffe Mon Sep 17 00:00:00 2001 From: Gulam Ali H <31090457+FreakyAli@users.noreply.github.com> Date: Fri, 8 Sep 2023 21:22:40 +0530 Subject: [PATCH] fix: code clean up for codefactor --- .../Shared/Extensions/ExceptionExtensions.cs | 3 -- MAUI.FreakyControls/Samples/AppShell.xaml.cs | 1 - .../JumpList/EnglishAlphabetProvider.cs | 28 +++++++++---------- .../Samples/JumpList/JumpListViewModel.cs | 3 +- MAUI.FreakyControls/Samples/MainViewModel.cs | 2 -- .../Samples/PermissionHelper.cs | 3 +- 6 files changed, 15 insertions(+), 25 deletions(-) diff --git a/MAUI.FreakyControls/MAUI.FreakyControls/Shared/Extensions/ExceptionExtensions.cs b/MAUI.FreakyControls/MAUI.FreakyControls/Shared/Extensions/ExceptionExtensions.cs index 34d52274..96541213 100644 --- a/MAUI.FreakyControls/MAUI.FreakyControls/Shared/Extensions/ExceptionExtensions.cs +++ b/MAUI.FreakyControls/MAUI.FreakyControls/Shared/Extensions/ExceptionExtensions.cs @@ -5,11 +5,9 @@ namespace Maui.FreakyControls.Extensions; public static class ExceptionExtensions { - public static void TraceException(this Exception exception) { var stringBuilder = new StringBuilder(); - while (exception != null) { stringBuilder.AppendLine(exception.Message); @@ -17,7 +15,6 @@ public static void TraceException(this Exception exception) exception = exception.InnerException; } - Trace.TraceError(stringBuilder.ToString()); } } \ No newline at end of file diff --git a/MAUI.FreakyControls/Samples/AppShell.xaml.cs b/MAUI.FreakyControls/Samples/AppShell.xaml.cs index dc5cba58..cef210e8 100644 --- a/MAUI.FreakyControls/Samples/AppShell.xaml.cs +++ b/MAUI.FreakyControls/Samples/AppShell.xaml.cs @@ -26,6 +26,5 @@ public AppShell() Routing.RegisterRoute(radioButtons, typeof(RadioButtons.RadioButtonsView)); Routing.RegisterRoute(buttons, typeof(ButtonsView.ButtonsView)); Routing.RegisterRoute(jumpList, typeof(JumpList.JumpListView)); - } } \ No newline at end of file diff --git a/MAUI.FreakyControls/Samples/JumpList/EnglishAlphabetProvider.cs b/MAUI.FreakyControls/Samples/JumpList/EnglishAlphabetProvider.cs index 173e79bf..ffeba249 100644 --- a/MAUI.FreakyControls/Samples/JumpList/EnglishAlphabetProvider.cs +++ b/MAUI.FreakyControls/Samples/JumpList/EnglishAlphabetProvider.cs @@ -1,23 +1,21 @@ using Maui.FreakyControls; -namespace Samples.JumpList -{ - public class EnglishAlphabetProvider : IAlphabetProvider - { - private string alphabets = "ABCDEFGHIJKLMNOPQRSTUVWXYZ#"; +namespace Samples.JumpList; - public IEnumerable GetAlphabet() - { - foreach (var c in alphabets) - { - yield return c; - } - } +public class EnglishAlphabetProvider : IAlphabetProvider +{ + private string alphabets = "ABCDEFGHIJKLMNOPQRSTUVWXYZ#"; - public int GetCount() + public IEnumerable GetAlphabet() + { + foreach (var c in alphabets) { - return alphabets.Length; + yield return c; } } -} + public int GetCount() + { + return alphabets.Length; + } +} \ No newline at end of file diff --git a/MAUI.FreakyControls/Samples/JumpList/JumpListViewModel.cs b/MAUI.FreakyControls/Samples/JumpList/JumpListViewModel.cs index 92d8d910..973e174d 100644 --- a/MAUI.FreakyControls/Samples/JumpList/JumpListViewModel.cs +++ b/MAUI.FreakyControls/Samples/JumpList/JumpListViewModel.cs @@ -39,5 +39,4 @@ public JumpListViewModel() Names = names.OrderBy(x => x).ToList(); } -} - +} \ No newline at end of file diff --git a/MAUI.FreakyControls/Samples/MainViewModel.cs b/MAUI.FreakyControls/Samples/MainViewModel.cs index 822366ba..8d8d57ba 100644 --- a/MAUI.FreakyControls/Samples/MainViewModel.cs +++ b/MAUI.FreakyControls/Samples/MainViewModel.cs @@ -7,7 +7,6 @@ namespace Samples { public class MainViewModel : BaseViewModel { - private ObservableCollection items; public MainViewModel() @@ -26,7 +25,6 @@ public MainViewModel() AppShell.radioButtons, AppShell.buttons, AppShell.jumpList - }; } diff --git a/MAUI.FreakyControls/Samples/PermissionHelper.cs b/MAUI.FreakyControls/Samples/PermissionHelper.cs index 31aecc15..b495b56d 100644 --- a/MAUI.FreakyControls/Samples/PermissionHelper.cs +++ b/MAUI.FreakyControls/Samples/PermissionHelper.cs @@ -35,5 +35,4 @@ public static async Task CheckAndRequestPermissionAsync(Fun status = await Permissions.RequestAsync(); return status; } -} - +} \ No newline at end of file