mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
C#: Some test examples of collection like types that should be excluded.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NoSummaries;
|
||||
|
||||
@@ -110,4 +111,24 @@ public abstract class BaseClass
|
||||
|
||||
// Negative summary.
|
||||
public abstract string M2(string s);
|
||||
}
|
||||
|
||||
// No methods in this class will have generated flow as
|
||||
// the simple types used in the collection are not bulk data types.
|
||||
public class CollectionFlow
|
||||
{
|
||||
public int[] ReturnSimpleTypeArray(int[] a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
||||
public List<int> ReturnSimpleTypeList(List<int> a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
||||
public Dictionary<int, int> ReturnSimpleTypeDictionary(Dictionary<int, int> a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Summaries;
|
||||
@@ -85,6 +86,31 @@ public class CollectionFlow
|
||||
{
|
||||
return new List<string> { tainted };
|
||||
}
|
||||
|
||||
public string[] ReturnComplexTypeArray(string[] a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
||||
public List<byte> ReturnBulkTypeList(List<byte> a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
||||
public Dictionary<int, string> ReturnComplexTypeDictionary(Dictionary<int, string> a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
||||
public Array ReturnUntypedArray(Array a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
||||
public IList ReturnUntypedList(IList a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
public class IEnumerableFlow
|
||||
|
||||
Reference in New Issue
Block a user