C#: Remove the override and ext column from the summaries printing test.

This commit is contained in:
Michael Nebel
2024-05-16 15:08:45 +02:00
parent b1329fd806
commit 763d53afed
4 changed files with 12 additions and 8 deletions

View File

@@ -516,10 +516,13 @@ string asPartialModel(UnboundCallable c) {
) )
} }
/** Computes the first 4 columns for neutral CSV rows of `c`. */ /**
string asPartialNeutralModel(UnboundCallable c) { * Gets the signature of `c` in the format `namespace;type;name;parameters`.
*/
string getSignature(UnboundCallable c) {
exists(string namespace, string type, string name, string parameters | exists(string namespace, string type, string name, string parameters |
partialModel(c, namespace, type, name, parameters) and partialModel(c, namespace, type, name, parameters)
|
result = result =
namespace + ";" // namespace + ";" //
+ type + ";" // + type + ";" //

View File

@@ -80,7 +80,8 @@ class TargetApiSpecific extends CS::Callable {
predicate asPartialModel = ExternalFlow::asPartialModel/1; predicate asPartialModel = ExternalFlow::asPartialModel/1;
predicate asPartialNeutralModel = ExternalFlow::asPartialNeutralModel/1; /** Computes the first 4 columns for neutral CSV rows of `c`. */
predicate asPartialNeutralModel = ExternalFlow::getSignature/1;
/** /**
* Holds if `t` is a type that is generally used for bulk data in collection types. * Holds if `t` is a type that is generally used for bulk data in collection types.

View File

@@ -4,15 +4,15 @@ import semmle.code.csharp.dataflow.internal.ExternalFlow
final private class NeutralCallableFinal = NeutralCallable; final private class NeutralCallableFinal = NeutralCallable;
class RelevantNeutralCallable extends NeutralCallableFinal { class RelevantNeutralCallable extends NeutralCallableFinal {
final string getCallableCsv() { result = asPartialNeutralModel(this) } final string getCallableCsv() { result = getSignature(this) }
} }
class RelevantSourceCallable extends SourceCallable { class RelevantSourceCallable extends SourceCallable {
string getCallableCsv() { result = asPartialModel(this) } string getCallableCsv() { result = getSignature(this) }
} }
class RelevantSinkCallable extends SinkCallable { class RelevantSinkCallable extends SinkCallable {
string getCallableCsv() { result = asPartialModel(this) } string getCallableCsv() { result = getSignature(this) }
} }
import TestSummaryOutput<IncludeSummarizedCallable> import TestSummaryOutput<IncludeSummarizedCallable>

View File

@@ -10,7 +10,7 @@ class IncludeSummarizedCallable extends SummarizedCallableImplFinal {
} }
/** Gets a string representing the callable in semi-colon separated format for use in flow summaries. */ /** Gets a string representing the callable in semi-colon separated format for use in flow summaries. */
final string getCallableCsv() { result = asPartialModel(this) } final string getCallableCsv() { result = getSignature(this) }
predicate relevantSummary( predicate relevantSummary(
SummaryComponentStack input, SummaryComponentStack output, boolean preservesValue SummaryComponentStack input, SummaryComponentStack output, boolean preservesValue