Commit 94662ee
authored
Merge pull request #28 from magic5644/refactor-code-introduce-exceptions
Summary of PR #28: Refactor error handling and simplify graph processing
Title: Refactor error handling and simplify graph processing
Description:
Introduces custom exception classes for better error handling and user feedback.
Simplifies node and edge extraction processes.
Enhances degree calculation and error messaging in DependencyGraphGenerator and CoreUtils.
File Changes:
CodeLineCounter.Tests/CodeAnalyzerTests.cs
Refactored tests to remove redundant console output redirection.
Simplified test setup and assertions.
CodeLineCounter.Tests/CodeDuplicationCheckerTests.cs
Refactored tests to inherit from TestBase.
Removed redundant console output redirection.
Simplified test setup and assertions.
CodeLineCounter.Tests/CoreUtilsTests.cs
Refactored tests to inherit from TestBase.
Removed redundant console output redirection.
Simplified test setup and assertions.
CodeLineCounter.Tests/CsvHandlerTests.cs
Refactored tests to inherit from TestBase.
Removed redundant console output redirection.
Simplified test setup and assertions.
CodeLineCounter.Tests/CyclomaticComplexityCalculatorTests.cs
Refactored tests to inherit from TestBase.
Removed redundant console output redirection.
Simplified test setup and assertions.
CodeLineCounter.Tests/DataExporterTests.cs
Refactored tests to inherit from TestBase.
Removed redundant console output redirection.
Simplified test setup and assertions.
CodeLineCounter.Tests/DependencyGraphGeneratorTests.cs
Refactored tests to inherit from TestBase.
Removed redundant console output redirection.
Simplified test setup and assertions.
CodeLineCounter.Tests/FileUtilsTests.cs
Refactored tests to inherit from TestBase.
Removed redundant console output redirection.
Simplified test setup and assertions.
CodeLineCounter.Tests/HashUtilsTests.cs
Removed redundant console output redirection.
Simplified test setup and assertions.
CodeLineCounter.Tests/JsonHandlerTests.cs
Refactored tests to inherit from TestBase.
Removed redundant console output redirection.
Simplified test setup and assertions.
CodeLineCounter.Tests/SolutionAnalyzerTests.cs
Refactored tests to inherit from TestBase.
Removed redundant console output redirection.
Simplified test setup and assertions.
CodeLineCounter.Tests/TestBase.cs
Added a new base class for tests to handle console redirection and cleanup.
CodeLineCounter/Exceptions/HelpRequestedException.cs
Added a new custom exception for help requests.
CodeLineCounter/Exceptions/InvalidExportFormatException.cs
Added a new custom exception for invalid export formats.
CodeLineCounter/Exceptions/InvalidNumberException.cs
Added a new custom exception for invalid number inputs.
CodeLineCounter/Exceptions/InvalidSelectionException.cs
Added a new custom exception for invalid selection inputs.
CodeLineCounter/Models/Settings.cs
Updated IsValid method to throw custom exceptions.
CodeLineCounter/Program.cs
Added try-catch blocks for better error handling.
CodeLineCounter/Services/DependencyGraphGenerator.cs
Minor formatting changes.
CodeLineCounter/Services/SolutionAnalyzer.cs
Updated error handling to use Console.WriteLine instead of Console.Error.WriteLine.
CodeLineCounter/Utils/CoreUtils.cs
Updated methods to throw custom exceptions for invalid inputs.File tree
21 files changed
+951
-1397
lines changed- CodeLineCounter.Tests
- CodeLineCounter
- Exceptions
- Models
- Services
- Utils
21 files changed
+951
-1397
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | 9 | | |
17 | 10 | | |
18 | 11 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
40 | 28 | | |
41 | 29 | | |
42 | 30 | | |
43 | 31 | | |
44 | 32 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 33 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
53 | 38 | | |
54 | 39 | | |
55 | 40 | | |
56 | 41 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 42 | + | |
61 | 43 | | |
62 | | - | |
63 | | - | |
| 44 | + | |
| 45 | + | |
64 | 46 | | |
65 | | - | |
66 | | - | |
67 | | - | |
| 47 | + | |
| 48 | + | |
68 | 49 | | |
69 | 50 | | |
70 | 51 | | |
71 | 52 | | |
72 | 53 | | |
73 | 54 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | 55 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
82 | 60 | | |
83 | 61 | | |
84 | 62 | | |
85 | 63 | | |
86 | | - | |
| 64 | + | |
87 | 65 | | |
88 | | - | |
89 | | - | |
| 66 | + | |
| 67 | + | |
90 | 68 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
| 69 | + | |
| 70 | + | |
96 | 71 | | |
97 | 72 | | |
98 | 73 | | |
99 | 74 | | |
100 | 75 | | |
101 | 76 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | 77 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
110 | 82 | | |
111 | 83 | | |
112 | 84 | | |
113 | 85 | | |
114 | | - | |
| 86 | + | |
115 | 87 | | |
116 | | - | |
117 | | - | |
| 88 | + | |
| 89 | + | |
118 | 90 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 91 | + | |
| 92 | + | |
124 | 93 | | |
125 | 94 | | |
126 | 95 | | |
| |||
0 commit comments