diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll index a7776cd9600..79e39aa7df1 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll @@ -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 | - partialModel(c, namespace, type, name, parameters) and + partialModel(c, namespace, type, name, parameters) + | result = namespace + ";" // + type + ";" // diff --git a/csharp/ql/src/utils/modelgenerator/internal/CaptureModelsSpecific.qll b/csharp/ql/src/utils/modelgenerator/internal/CaptureModelsSpecific.qll index b1c2475729c..a526b01a6c8 100644 --- a/csharp/ql/src/utils/modelgenerator/internal/CaptureModelsSpecific.qll +++ b/csharp/ql/src/utils/modelgenerator/internal/CaptureModelsSpecific.qll @@ -80,7 +80,8 @@ class TargetApiSpecific extends CS::Callable { 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. diff --git a/csharp/ql/test/library-tests/dataflow/library/FlowSummaries.ql b/csharp/ql/test/library-tests/dataflow/library/FlowSummaries.ql index 6b117c03ac0..ccdf691d0b2 100644 --- a/csharp/ql/test/library-tests/dataflow/library/FlowSummaries.ql +++ b/csharp/ql/test/library-tests/dataflow/library/FlowSummaries.ql @@ -4,15 +4,15 @@ import semmle.code.csharp.dataflow.internal.ExternalFlow final private class NeutralCallableFinal = NeutralCallable; class RelevantNeutralCallable extends NeutralCallableFinal { - final string getCallableCsv() { result = asPartialNeutralModel(this) } + final string getCallableCsv() { result = getSignature(this) } } class RelevantSourceCallable extends SourceCallable { - string getCallableCsv() { result = asPartialModel(this) } + string getCallableCsv() { result = getSignature(this) } } class RelevantSinkCallable extends SinkCallable { - string getCallableCsv() { result = asPartialModel(this) } + string getCallableCsv() { result = getSignature(this) } } import TestSummaryOutput diff --git a/csharp/ql/test/shared/FlowSummaries.qll b/csharp/ql/test/shared/FlowSummaries.qll index 47b1a005c5d..a9fbeb8f08e 100644 --- a/csharp/ql/test/shared/FlowSummaries.qll +++ b/csharp/ql/test/shared/FlowSummaries.qll @@ -10,7 +10,7 @@ class IncludeSummarizedCallable extends SummarizedCallableImplFinal { } /** 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( SummaryComponentStack input, SummaryComponentStack output, boolean preservesValue