From 37ae9677fa9a32777361fc6a8bd1528cfc243357 Mon Sep 17 00:00:00 2001 From: Irma Date: Mon, 4 Sep 2023 12:42:07 +0200 Subject: [PATCH 1/3] worsen the file --- SynonymsAPI/Services/BadService.cs | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/SynonymsAPI/Services/BadService.cs b/SynonymsAPI/Services/BadService.cs index c68c883..7da3a77 100644 --- a/SynonymsAPI/Services/BadService.cs +++ b/SynonymsAPI/Services/BadService.cs @@ -485,6 +485,46 @@ public bool Add_Test_123(string word) } } + public decimal Calculate(decimal amount, int type, int years, bool foo1, bool foo2, bool foo3) + { + 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)); + } + return result; + } + public decimal Calculate(decimal amount, int type, int years) { decimal result = 0; From 1ea70bd96715556131671e3057e994b3388c5736 Mon Sep 17 00:00:00 2001 From: Irma Date: Thu, 7 Sep 2023 09:31:32 +0200 Subject: [PATCH 2/3] small change --- SynonymsAPI/Services/BadService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SynonymsAPI/Services/BadService.cs b/SynonymsAPI/Services/BadService.cs index 7da3a77..63ed535 100644 --- a/SynonymsAPI/Services/BadService.cs +++ b/SynonymsAPI/Services/BadService.cs @@ -466,7 +466,7 @@ public bool Add_Test_123(string word) } } - else if (word == "C") + else if (word == "A") { if (word == "BA") { @@ -479,6 +479,7 @@ public bool Add_Test_123(string word) } return true; } + catch (Exception) { return false; From 2bc19cfe5d7e2e7475ae58cae9989daeaabcdf1f Mon Sep 17 00:00:00 2001 From: Irma Date: Thu, 7 Sep 2023 11:50:18 +0200 Subject: [PATCH 3/3] Added directive --- SynonymsAPI/Services/BadService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/SynonymsAPI/Services/BadService.cs b/SynonymsAPI/Services/BadService.cs index 63ed535..2c25653 100644 --- a/SynonymsAPI/Services/BadService.cs +++ b/SynonymsAPI/Services/BadService.cs @@ -526,6 +526,7 @@ public decimal Calculate(decimal amount, int type, int years, bool foo1, bool fo return result; } + @CodeScene(disable:\"Complex Method\") public decimal Calculate(decimal amount, int type, int years) { decimal result = 0;