Skip to content

Commit 5e9826d

Browse files
cleanup
1 parent c6ac294 commit 5e9826d

135 files changed

Lines changed: 266 additions & 324 deletions

File tree

Some content is hidden

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

CommonControls/Thumbnails.xaml.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,8 @@ private async Task LoadImages()
577577
/// <returns>
578578
/// Load all images async
579579
/// </returns>
580-
private async Task LoadSingleImage(int key, string filePath, Panel exGrid, CancellationToken token, int cellSize, int thumbWidth)
580+
private async Task LoadSingleImage(int key, string filePath, Panel exGrid, CancellationToken token, int cellSize,
581+
int thumbWidth)
581582
{
582583
if (token.IsCancellationRequested) return;
583584

@@ -589,12 +590,7 @@ private async Task LoadSingleImage(int key, string filePath, Panel exGrid, Cance
589590
if (bitmap == null) return;
590591

591592
// Prepare UI elements
592-
var images = new Image
593-
{
594-
Height = cellSize,
595-
Width = cellSize,
596-
Name = $"{ComCtlResources.ImageAdd}{key}"
597-
};
593+
var images = new Image { Height = cellSize, Width = cellSize, Name = $"{ComCtlResources.ImageAdd}{key}" };
598594

599595
var border = new Border
600596
{
@@ -1008,4 +1004,4 @@ private void Dispose(bool disposing)
10081004
{
10091005
Dispose(false);
10101006
}
1011-
}
1007+
}

CoreBuilder/CommandFactory.cs

Lines changed: 20 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,13 @@ public static IReadOnlyList<ICommand> GetCommands()
3131
{
3232
ICommand[] modules =
3333
{
34-
new DirectorySizeAnalyzer(),
35-
new LogTailCommand(),
36-
new HeaderExtractor(),
37-
new ResXtract(),
38-
new AllocationAnalyzer(),
39-
new DisposableAnalyzer(),
40-
new DoubleNewlineAnalyzer(),
41-
new DuplicateStringLiteralAnalyzer(),
42-
new EventHandlerAnalyzer(),
43-
new HotPathAnalyzer(),
44-
new LicenseHeaderAnalyzer(),
45-
new UnusedClassAnalyzer(),
46-
new UnusedConstantAnalyzer(),
47-
new UnusedLocalVariableAnalyzer(),
48-
new UnusedParameterAnalyzer(),
49-
new UnusedPrivateFieldAnalyzer(),
50-
new DocCommentCoverageCommand(),
51-
new DeadReferenceAnalyzer(),
52-
new ApiExplorerCommand(),
53-
new FileLockScanner(),
54-
new SmartPingPro(),
55-
new WhoAmI(),
56-
new Tree()
34+
new DirectorySizeAnalyzer(), new LogTailCommand(), new HeaderExtractor(), new ResXtract(),
35+
new AllocationAnalyzer(), new DisposableAnalyzer(), new DoubleNewlineAnalyzer(),
36+
new DuplicateStringLiteralAnalyzer(), new EventHandlerAnalyzer(), new HotPathAnalyzer(),
37+
new LicenseHeaderAnalyzer(), new UnusedClassAnalyzer(), new UnusedConstantAnalyzer(),
38+
new UnusedLocalVariableAnalyzer(), new UnusedParameterAnalyzer(), new UnusedPrivateFieldAnalyzer(),
39+
new DocCommentCoverageCommand(), new DeadReferenceAnalyzer(), new ApiExplorerCommand(),
40+
new FileLockScanner(), new SmartPingPro(), new WhoAmI(), new Tree()
5741
};
5842

5943
return modules;
@@ -68,30 +52,13 @@ public static IReadOnlyList<ICommand> GetCommands(string userspace)
6852
{
6953
ICommand[] modules =
7054
{
71-
new DirectorySizeAnalyzer(),
72-
new DirectorySizeAnalyzer(),
73-
new LogTailCommand(),
74-
new HeaderExtractor(),
75-
new ResXtract(),
76-
new AllocationAnalyzer(),
77-
new DisposableAnalyzer(),
78-
new DoubleNewlineAnalyzer(),
79-
new DuplicateStringLiteralAnalyzer(),
80-
new EventHandlerAnalyzer(),
81-
new HotPathAnalyzer(),
82-
new LicenseHeaderAnalyzer(),
83-
new UnusedClassAnalyzer(),
84-
new UnusedConstantAnalyzer(),
85-
new UnusedLocalVariableAnalyzer(),
86-
new UnusedParameterAnalyzer(),
87-
new UnusedPrivateFieldAnalyzer(),
88-
new DocCommentCoverageCommand(),
89-
new DeadReferenceAnalyzer(),
90-
new ApiExplorerCommand(),
91-
new FileLockScanner(),
92-
new SmartPingPro(),
93-
new WhoAmI(),
94-
new Tree()
55+
new DirectorySizeAnalyzer(), new DirectorySizeAnalyzer(), new LogTailCommand(),
56+
new HeaderExtractor(), new ResXtract(), new AllocationAnalyzer(), new DisposableAnalyzer(),
57+
new DoubleNewlineAnalyzer(), new DuplicateStringLiteralAnalyzer(), new EventHandlerAnalyzer(),
58+
new HotPathAnalyzer(), new LicenseHeaderAnalyzer(), new UnusedClassAnalyzer(),
59+
new UnusedConstantAnalyzer(), new UnusedLocalVariableAnalyzer(), new UnusedParameterAnalyzer(),
60+
new UnusedPrivateFieldAnalyzer(), new DocCommentCoverageCommand(), new DeadReferenceAnalyzer(),
61+
new ApiExplorerCommand(), new FileLockScanner(), new SmartPingPro(), new WhoAmI(), new Tree()
9562
};
9663

9764
// Filter by Namespace
@@ -106,10 +73,7 @@ public static IReadOnlyList<ICommand> GetCommands(string userspace)
10673
/// <returns>All Extensions</returns>
10774
public static IReadOnlyList<ICommandExtension> GetExtensions()
10875
{
109-
ICommandExtension[] modules =
110-
{
111-
new WhoAmIExtension()
112-
};
76+
ICommandExtension[] modules = { new WhoAmIExtension() };
11377

11478
return modules;
11579
}
@@ -122,20 +86,11 @@ public static IReadOnlyList<ICodeAnalyzer> GetAllAnalyzers()
12286
{
12387
ICodeAnalyzer[] modules =
12488
{
125-
new AllocationAnalyzer(),
126-
new DisposableAnalyzer(),
127-
new DoubleNewlineAnalyzer(),
128-
new DuplicateStringLiteralAnalyzer(),
129-
new EventHandlerAnalyzer(),
130-
new HotPathAnalyzer(),
131-
new LicenseHeaderAnalyzer(),
132-
new UnusedClassAnalyzer(),
133-
new UnusedConstantAnalyzer(),
134-
new UnusedLocalVariableAnalyzer(),
135-
new UnusedParameterAnalyzer(),
136-
new UnusedPrivateFieldAnalyzer(),
137-
new DocCommentCoverageCommand(),
138-
new DeadReferenceAnalyzer()
89+
new AllocationAnalyzer(), new DisposableAnalyzer(), new DoubleNewlineAnalyzer(),
90+
new DuplicateStringLiteralAnalyzer(), new EventHandlerAnalyzer(), new HotPathAnalyzer(),
91+
new LicenseHeaderAnalyzer(), new UnusedClassAnalyzer(), new UnusedConstantAnalyzer(),
92+
new UnusedLocalVariableAnalyzer(), new UnusedParameterAnalyzer(), new UnusedPrivateFieldAnalyzer(),
93+
new DocCommentCoverageCommand(), new DeadReferenceAnalyzer()
13994
};
14095

14196
return modules;

CoreBuilder/CoreResources.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ internal static class CoreResources
2222
/// The resource cs project extension
2323
/// </summary>
2424
internal const string ResourceCsProjectExtension = "*.csproj";
25-
}
25+
}

CoreBuilder/Development/ApiExplorerCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,4 @@ private static bool IsPublic(SyntaxTokenList modifiers)
172172
public CommandResult InvokeExtension(string extensionName, params string[] args)
173173
=> CommandResult.Fail($"'{Name}' has no extensions.");
174174
}
175-
}
175+
}

CoreBuilder/Development/HeaderExtractor.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,7 @@ public CommandResult InvokeExtension(string extensionName, params string[] args)
171171
"no" => CommandResult.Fail("Operation cancelled by user."),
172172
_ => new CommandResult
173173
{
174-
Message = "Please answer yes/no.",
175-
RequiresConfirmation = true,
176-
Feedback = cache
174+
Message = "Please answer yes/no.", RequiresConfirmation = true, Feedback = cache
177175
}
178176
};
179177
});
@@ -245,4 +243,4 @@ private static string InsertHeader(string fileContent, string fileName, string p
245243
var header = string.Format(HeaderTemplate, namespaceName, fileName, purpose, programmerName);
246244
return string.Concat(header, Environment.NewLine, fileContent);
247245
}
248-
}
246+
}

CoreBuilder/Development/ResXtract.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,7 @@ public CommandResult Execute(params string[] args)
121121
if (string.IsNullOrWhiteSpace(result))
122122
return CommandResult.Ok("No files would be changed.");
123123

124-
return new CommandResult
125-
{
126-
Success = true,
127-
Message = "Files that would be affected:\n" + result
128-
};
124+
return new CommandResult { Success = true, Message = "Files that would be affected:\n" + result };
129125
}
130126

131127
// standard mode
@@ -134,11 +130,7 @@ public CommandResult Execute(params string[] args)
134130
? "No files changed."
135131
: $"Updated {changed.Count} files:\n" + string.Join(Environment.NewLine, changed);
136132

137-
return new CommandResult
138-
{
139-
Success = true,
140-
Message = msg
141-
};
133+
return new CommandResult { Success = true, Message = msg };
142134
}
143135

144136
/// <inheritdoc />
@@ -170,9 +162,7 @@ public CommandResult InvokeExtension(string extensionName, params string[] args)
170162
"no" => CommandResult.Fail("Operation cancelled by user."),
171163
_ => new CommandResult
172164
{
173-
Message = "Please answer yes/no.",
174-
RequiresConfirmation = true,
175-
Feedback = cache
165+
Message = "Please answer yes/no.", RequiresConfirmation = true, Feedback = cache
176166
}
177167
};
178168
});

CoreBuilder/Diagnostic.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@ public override string ToString()
9797
? $"{Name}, {Severity}, {FilePath}({LineNumber}): {Message} [{Impact.Value}]"
9898
: $"{Name}, {Severity}, {FilePath}({LineNumber}): {Message}";
9999
}
100-
}
100+
}

CoreBuilder/Enums/DiagnosticImpact.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ public enum DiagnosticImpact
3434
Other = 3,
3535
Readability = 4
3636
}
37-
}
37+
}

CoreBuilder/Enums/DiagnosticSeverity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ public enum DiagnosticSeverity
2828
/// </summary>
2929
Error = 2
3030
}
31-
}
31+
}

CoreBuilder/Enums/LoopContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ public enum LoopContext
3232
/// The nested
3333
/// </summary>
3434
Nested = 3
35-
}
35+
}

0 commit comments

Comments
 (0)