Conversation
There was a problem hiding this comment.
❌ Quality Gates: FAILED
- Declining Code Health: 2 findings(s) 🚩
- Improving Code Health: 7 findings(s) ✅
- Affected Hotspots: 2 files(s) 🔥
Recommended Review Level: Detailed -- Inspect the code that degrades in code health.
View detailed results in CodeScene
🚩 Negative Code Health Impact (highest to lowest):
- Complex Method SynonymsService.cs: Add 🔥
- Complex Method SynonymsService.cs: AddTest 🔥
✅ Positive Code Health Impact (highest to lowest):
- Code Duplication BadService.cs 🔥
- Overall Code Complexity BadService.cs 🔥
- Complex Method BadService.cs: Add 🔥
- Complex Method BadService.cs: Calculate 🔥
- Complex Method BadService.cs 🔥
- Bumpy Road Ahead BadService.cs: Add 🔥
- Deep, Nested Complexity BadService.cs: Add 🔥
| { | ||
| try | ||
| { | ||
| if (word == "A") |
There was a problem hiding this comment.
✅ 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.
| 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") | ||
| { | ||
|
|
||
| } |
There was a problem hiding this comment.
✅ Getting better: Complex Method
Add decreases in cyclomatic complexity from 18 to 10, threshold = 9
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.
| 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)); | ||
| } |
There was a problem hiding this comment.
✅ No longer an issue: Complex Method
Calculate is no longer above the threshold for cyclomatic complexity
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.
| { | ||
| try | ||
| { | ||
| if (word == "A") |
There was a problem hiding this comment.
✅ No longer an issue: Complex Method
Add is no longer above the threshold for cyclomatic complexity
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.
| { | ||
| try | ||
| { | ||
| if (word == "A") |
There was a problem hiding this comment.
✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 9.25 to 7.38, threshold = 4
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.
| 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") | ||
| { | ||
|
|
||
| } |
There was a problem hiding this comment.
✅ No longer an issue: Bumpy Road Ahead
Add is no longer above the threshold for logical blocks with deeply nested code
| 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") | ||
| { | ||
|
|
||
| } |
There was a problem hiding this comment.
✅ No longer an issue: Deep, Nested Complexity
Add is no longer above the threshold for nested complexity depth
| if (word == "A") | ||
| { |
There was a problem hiding this comment.
❌ Getting worse: Complex Method
Add increases in cyclomatic complexity from 15 to 24, threshold = 9
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.
| { | ||
| if (word == "BA") | ||
| { | ||
| if (word == "A") |
There was a problem hiding this comment.
ℹ Getting worse: Overall Code Complexity
The mean cyclomatic complexity increases from 6.15 to 7.54, threshold = 4
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.
There was a problem hiding this comment.
❌ Quality Gates: FAILED
- Declining Code Health: 2 findings(s) 🚩
- Improving Code Health: 7 findings(s) ✅
- Affected Hotspots: 2 files(s) 🔥
Recommended Review Level: Detailed -- Inspect the code that degrades in code health.
View detailed results in CodeScene
🚩 Negative Code Health Impact (highest to lowest):
- Complex Method SynonymsService.cs: Add 🔥
- Complex Method SynonymsService.cs: AddTest 🔥
✅ Positive Code Health Impact (highest to lowest):
- Code Duplication BadService.cs: Calculate 🔥
- Overall Code Complexity BadService.cs 🔥
- Complex Method BadService.cs: Add 🔥
- Complex Method BadService.cs: Calculate 🔥
- Complex Method BadService.cs: Add 🔥
- Bumpy Road Ahead BadService.cs: Add 🔥
- Deep, Nested Complexity BadService.cs: Add 🔥
There was a problem hiding this comment.
❌ Quality Gates: FAILED
- Declining Code Health: 1 findings(s) 🚩
- Improving Code Health: 7 findings(s) ✅
- Affected Hotspots: 2 files(s) 🔥
Recommended Review Level: Detailed -- Inspect the code that degrades in code health.
View detailed results in CodeScene
🚩 Negative Code Health Impact (highest to lowest):
- Complex Method SynonymsService.cs: Add 🔥
✅ Positive Code Health Impact (highest to lowest):
- Code Duplication BadService.cs: Calculate 🔥
- Overall Code Complexity BadService.cs 🔥
- Complex Method BadService.cs: Add 🔥
- Complex Method BadService.cs: Calculate 🔥
- Complex Method BadService.cs: Add 🔥
- Bumpy Road Ahead BadService.cs: Add 🔥
- Deep, Nested Complexity BadService.cs: Add 🔥
There was a problem hiding this comment.
❌ Quality Gates: FAILED
- Declining Code Health: 1 findings(s) 🚩
- Improving Code Health: 7 findings(s) ✅
- Affected Hotspots: 2 files(s) 🔥
Recommended Review Level: Detailed -- Inspect the code that degrades in code health.
View detailed results in CodeScene
🚩 Negative Code Health Impact (highest to lowest):
- Complex Method SynonymsService.cs: Add 🔥
✅ Positive Code Health Impact (highest to lowest):
- Code Duplication BadService.cs: Calculate 🔥
- Overall Code Complexity BadService.cs 🔥
- Complex Method BadService.cs: Add 🔥
- Complex Method BadService.cs: Calculate 🔥
- Complex Method BadService.cs: Add 🔥
- Bumpy Road Ahead BadService.cs: Add 🔥
- Deep, Nested Complexity BadService.cs: Add 🔥
No description provided.