Skip to content

Commit 66035d8

Browse files
committed
Code cleanup
1 parent eb6e72c commit 66035d8

42 files changed

Lines changed: 100 additions & 135 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ApprovalTestTool/Hash.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
namespace ApprovalTestTool;
55

6-
/// <summary>
76
public static class Hash
87
{
98
public static string ComputeHash(string input)

CSharpCodeAnalyst/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private void StartUi()
110110
mainWindow.SetViewer(explorationGraphViewer, messaging);
111111

112112
var projectStorage = new JsonProjectStorage(uiNotification);
113-
var projectService = new ProjectService(projectStorage, uiNotification, userSettings);
113+
var projectService = new ProjectService(projectStorage, userSettings);
114114

115115
var viewModel = new MainViewModel(messaging, applicationSettings, userSettings, analyzerManager, refactoringService, projectService);
116116
var graphViewModel = new GraphViewModel(explorationGraphViewer, explorer, messaging, applicationSettings, refactoringService);

CSharpCodeAnalyst/Features/AdvancedSearch/AdvancedSearchControl.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:resources="clr-namespace:CSharpCodeAnalyst.Resources"
77
xmlns:dd="urn:gong-wpf-dragdrop"
8+
xmlns:advancedSearch="clr-namespace:CSharpCodeAnalyst.Features.AdvancedSearch"
89
mc:Ignorable="d"
9-
d:DataContext="{d:DesignInstance local:AdvancedSearchViewModel}"
10+
d:DataContext="{d:DesignInstance advancedSearch:AdvancedSearchViewModel}"
1011
d:DesignHeight="300" d:DesignWidth="300">
1112
<UserControl.Resources>
1213
<ResourceDictionary>

CSharpCodeAnalyst/Features/AdvancedSearch/SearchItemViewModel.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,19 @@ namespace CSharpCodeAnalyst.Features.AdvancedSearch;
99
[DebuggerDisplay("{Type} {Name} - {FullPath}")]
1010
public sealed class SearchItemViewModel : INotifyPropertyChanged
1111
{
12-
private bool _isSelected;
13-
1412
public string Name { get; set; } = string.Empty;
1513
public string Type { get; set; } = string.Empty;
1614
public string FullPath { get; set; } = string.Empty;
1715
public CodeElement? CodeElement { get; set; }
1816

1917
public bool IsSelected
2018
{
21-
get => _isSelected;
19+
get;
2220
set
2321
{
24-
if (_isSelected != value)
22+
if (field != value)
2523
{
26-
_isSelected = value;
24+
field = value;
2725
OnPropertyChanged(nameof(IsSelected));
2826
}
2927
}

CSharpCodeAnalyst/Features/Analyzers/AnalyzerManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ public void LoadAnalyzers(IPublisher messaging, IUserNotification userNotificati
6363
_analyzers.Clear();
6464

6565
IAnalyzer analyzer = new Analyzer(messaging);
66-
analyzer.DataChanged += (sender, args) => RaiseAnalyzerDataChanged();
66+
analyzer.DataChanged += (_, _) => RaiseAnalyzerDataChanged();
6767
_analyzers.Add(analyzer.Id, analyzer);
6868

6969
analyzer = new ArchitecturalRules.Analyzer(messaging, userNotification);
70-
analyzer.DataChanged += (sender, args) => RaiseAnalyzerDataChanged();
70+
analyzer.DataChanged += (_, _) => RaiseAnalyzerDataChanged();
7171
_analyzers.Add(analyzer.Id, analyzer);
7272
}
7373

CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Analyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void Analyze(CodeGraph.Graph.CodeGraph graph)
6060
_openDialog.OnValidateRequested = OnValidateRules;
6161

6262
// Handle dialog closing
63-
_openDialog.Closed += (sender, args) =>
63+
_openDialog.Closed += (_, _) =>
6464
{
6565
_openDialog = null;
6666
_currentGraph = null;

CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Presentation;
88

99
public partial class ArchitecturalRulesDialog : INotifyPropertyChanged
1010
{
11-
private string _rulesText = string.Empty;
1211

1312
public ArchitecturalRulesDialog()
1413
{
@@ -18,15 +17,15 @@ public ArchitecturalRulesDialog()
1817

1918
public string RulesText
2019
{
21-
get => _rulesText;
20+
get;
2221
set
2322
{
24-
if (_rulesText == value) { return; }
23+
if (field == value) { return; }
2524

26-
_rulesText = value;
25+
field = value;
2726
OnPropertyChanged();
2827
}
29-
}
28+
} = string.Empty;
3029

3130
/// <summary>
3231
/// Callback invoked when the Validate button is clicked

CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/RuleViolationsViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public override ObservableCollection<TableRow> GetData()
5757
return _violations;
5858
}
5959

60-
public override DataTemplate? GetRowDetailsTemplate()
60+
public override DataTemplate GetRowDetailsTemplate()
6161
{
6262
var uri = new Uri(
6363
"/CSharpCodeAnalyst;component/Features/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml",

CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/IsolateRule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public override List<Relationship> ValidateRule(
1717

1818
foreach (var relationship in allRelationships)
1919
{
20-
// ISOLATE violation: source uses anything outside of itself
20+
// ISOLATE violation: source uses anything outside itself
2121
if (sourceIds.Contains(relationship.SourceId) && !sourceIds.Contains(relationship.TargetId))
2222
{
2323
violations.Add(relationship);

CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/EventImbalancesViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public override ObservableCollection<TableRow> GetData()
3434
return _imbalances;
3535
}
3636

37-
public override DataTemplate? GetRowDetailsTemplate()
37+
public override DataTemplate GetRowDetailsTemplate()
3838
{
3939
var uri = new Uri(
4040
"/CSharpCodeAnalyst;component/Features/Analyzers/EventRegistration/Presentation/SourceLocationTemplate.xaml",

0 commit comments

Comments
 (0)