-
Notifications
You must be signed in to change notification settings - Fork 3
Dummy 222 bug fix #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -137,28 +137,6 @@ public bool Add(string word, string foo) | |
| { | ||
| try | ||
| { | ||
| if (word == "A") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ No longer an issue: Complex Method Why does this problem occur?This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring. Read more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Getting better: Overall Code Complexity Why does this problem occur?This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals. Read more. |
||
| { | ||
|
|
||
| } | ||
| else if (word.Contains("B")) | ||
| { | ||
| if (word == "BA") | ||
| { | ||
|
|
||
| } | ||
| else if (word == "BB") | ||
| { | ||
| if (word == "A") | ||
| { | ||
|
|
||
| } | ||
| } | ||
| } | ||
| else if (word == "C") | ||
| { | ||
|
|
||
| } | ||
| return true; | ||
| } | ||
| catch (Exception) | ||
|
|
@@ -172,65 +150,6 @@ public bool Add(string word, int foo) | |
| { | ||
| try | ||
| { | ||
| if (word == "A") | ||
| { | ||
| if (word == "A") | ||
| { | ||
| if (word == "A") | ||
| { | ||
|
|
||
| } | ||
|
|
||
| } | ||
| else if (word.Contains("B")) | ||
| { | ||
| if (word == "BA") | ||
| { | ||
| if (word == "A") | ||
| { | ||
|
|
||
| } | ||
| else if (word.Contains("B")) | ||
| { | ||
| if (word == "BA") | ||
| { | ||
|
|
||
| } | ||
| else if (word == "BB") | ||
| { | ||
|
|
||
| } | ||
| } | ||
| else if (word == "C") | ||
| { | ||
|
|
||
| } | ||
| } | ||
| else if (word == "BB") | ||
| { | ||
|
|
||
| } | ||
| } | ||
| else if (word == "C") | ||
| { | ||
|
|
||
| } | ||
| } | ||
| else if (word.Contains("B")) | ||
| { | ||
| if (word == "BA") | ||
| { | ||
|
|
||
| } | ||
| else if (word == "BB") | ||
| { | ||
|
|
||
| } | ||
| } | ||
| else if (word == "C") | ||
| { | ||
|
|
||
| } | ||
|
Comment on lines
-175
to
-233
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Getting better: Complex Method Why does this problem occur?This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring. Read more.
Comment on lines
-175
to
-233
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ No longer an issue: Bumpy Road Ahead
Comment on lines
-175
to
-233
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ No longer an issue: Deep, Nested Complexity |
||
| return true; | ||
| } | ||
| catch (Exception) | ||
|
|
@@ -489,39 +408,6 @@ public decimal Calculate(decimal amount, int type, int years) | |
| { | ||
| decimal result = 0; | ||
| decimal disc = (years > 5) ? (decimal)5 / 100 : (decimal)years / 100; | ||
| if (type == 1) | ||
| { | ||
| result = amount; | ||
| if (type == 1) | ||
| { | ||
| result = amount; | ||
| } | ||
| else if (type == 2) | ||
| { | ||
| result = (amount - (0.1m * amount)) - disc * (amount - (0.1m * amount)); | ||
| } | ||
| else if (type == 3) | ||
| { | ||
| result = (0.7m * amount) - disc * (0.7m * amount); | ||
| } | ||
| else if (type == 4) | ||
| { | ||
| result = (amount - (0.5m * amount)) - disc * (amount - (0.5m * amount)); | ||
| } | ||
| return result; | ||
| } | ||
| else if (type == 2) | ||
| { | ||
| result = (amount - (0.1m * amount)) - disc * (amount - (0.1m * amount)); | ||
| } | ||
| else if (type == 3) | ||
| { | ||
| result = (0.7m * amount) - disc * (0.7m * amount); | ||
| } | ||
| else if (type == 4) | ||
| { | ||
| result = (amount - (0.5m * amount)) - disc * (amount - (0.5m * amount)); | ||
| } | ||
|
Comment on lines
-492
to
-524
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ No longer an issue: Complex Method Why does this problem occur?This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring. Read more. |
||
| return result; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,7 +105,39 @@ public bool Add(string word, List<string> synonyms) | |
| { | ||
| if (word == "BA") | ||
| { | ||
| if (word == "A") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ℹ Getting worse: Overall Code Complexity Why does this problem occur?This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals. Read more. To ignore this warning click here. |
||
| { | ||
|
Comment on lines
+108
to
+109
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❌ Getting worse: Complex Method Why does this problem occur?This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring. Read more. To ignore this warning click here. |
||
|
|
||
| } | ||
| else if (word.Contains("B")) | ||
| { | ||
| if (word == "BA") | ||
| { | ||
|
|
||
| } | ||
| else if (word == "BB") | ||
| { | ||
| if (word == "BA") | ||
| { | ||
|
|
||
| } | ||
| else if (word == "BB") | ||
| { | ||
| if (word == "BA") | ||
| { | ||
|
|
||
| } | ||
| else if (word == "BB") | ||
| { | ||
|
|
||
| } | ||
| } | ||
| } | ||
| } | ||
| else if (word == "C") | ||
| { | ||
|
|
||
| } | ||
| } | ||
| else if (word == "BB") | ||
| { | ||
|
|
@@ -224,7 +256,39 @@ public bool AddTest(string word) | |
| { | ||
| if (word == "BA") | ||
| { | ||
| if (word == "A") | ||
| { | ||
|
|
||
| } | ||
| else if (word.Contains("B")) | ||
| { | ||
| if (word == "BA") | ||
| { | ||
|
|
||
| } | ||
| else if (word == "BB") | ||
| { | ||
| if (word == "BA") | ||
| { | ||
|
|
||
| } | ||
| else if (word == "BB") | ||
| { | ||
| if (word == "BA") | ||
| { | ||
|
|
||
| } | ||
| else if (word == "BB") | ||
| { | ||
|
|
||
| } | ||
| } | ||
| } | ||
| } | ||
| else if (word == "C") | ||
| { | ||
|
|
||
| } | ||
| } | ||
| else if (word == "BB") | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Getting better: Code Duplication
reduced similar code in: Calculate
Why does this problem occur?
Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health. Read more.