From 1a9a7d104cbf40ad60098fccf692ee8e57dc1b62 Mon Sep 17 00:00:00 2001 From: Albert Mosialek Date: Tue, 3 Sep 2024 13:59:24 +0200 Subject: [PATCH 1/2] test code scanning --- MarkupConverter/MarkupConverter.csproj | 1 + MarkupConverter/TestCodeScanning.cs | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 MarkupConverter/TestCodeScanning.cs diff --git a/MarkupConverter/MarkupConverter.csproj b/MarkupConverter/MarkupConverter.csproj index 7b8590f..8014f6e 100644 --- a/MarkupConverter/MarkupConverter.csproj +++ b/MarkupConverter/MarkupConverter.csproj @@ -71,6 +71,7 @@ + diff --git a/MarkupConverter/TestCodeScanning.cs b/MarkupConverter/TestCodeScanning.cs new file mode 100644 index 0000000..f2e6f22 --- /dev/null +++ b/MarkupConverter/TestCodeScanning.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MarkupConverter +{ + internal class TestCodeScanning + { + static int i = 0; + public int TestMethod() + { + for(i++; i%3!=0;i++) + Console.WriteLine(i); + return i; + } + } +} From eb1ee681b1ff84f1fc914c30a1ef9e5d4719f070 Mon Sep 17 00:00:00 2001 From: Albert Mosialek Date: Tue, 3 Sep 2024 14:07:57 +0200 Subject: [PATCH 2/2] add class which should not pass --- MarkupConverter/TestCodeScanning.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MarkupConverter/TestCodeScanning.cs b/MarkupConverter/TestCodeScanning.cs index f2e6f22..34d3050 100644 --- a/MarkupConverter/TestCodeScanning.cs +++ b/MarkupConverter/TestCodeScanning.cs @@ -15,5 +15,15 @@ public int TestMethod() Console.WriteLine(i); return i; } + + } +} + +class Bad +{ + public static double SolveQuadratic(double a, double b, double c) + { + // TODO: handle case where a == 0 + return (-b + Math.Sqrt(b * b - 4 * a * c)) / (2 * a); } }