C#: Addressed review comments from hvitved

This commit is contained in:
Michael Nebel
2021-11-24 14:35:52 +01:00
parent a3ca9ad27d
commit b9d0a60ce7
7 changed files with 21 additions and 26 deletions

View File

@@ -2,22 +2,17 @@ import semmle.code.csharp.dataflow.FlowSummary
import semmle.code.csharp.dataflow.internal.FlowSummaryImpl::Private::TestOutput
abstract class IncludeSummarizedCallable extends RelevantSummarizedCallable {
/** Gets the qualified parameter types of this callable as a comma-separated string */
/** Gets the qualified parameter types of this callable as a comma-separated string. */
private string parameterQualifiedTypeNamesToString() {
result =
concat(int i |
exists(this.getParameter(i))
concat(Parameter p, int i |
p = this.getParameter(i)
|
this.getParameter(i).getType().getQualifiedName(), ", " order by i
p.getType().getQualifiedName(), ", " order by i
)
}
/* Gets a string representation of the input type signature of callable */
private string getCallableSignature() {
result = "(" + parameterQualifiedTypeNamesToString() + ")"
}
/* Gets a string representing, whether the declaring type is an interface */
/* Gets a string representing, whether the declaring type is an interface. */
private string getCallableOverride() {
if
this.getDeclaringType() instanceof Interface or
@@ -31,8 +26,8 @@ abstract class IncludeSummarizedCallable extends RelevantSummarizedCallable {
exists(string namespace, string type |
this.getDeclaringType().hasQualifiedName(namespace, type) and
result =
namespace + ";" + type + ";" + this.getCallableOverride() + ";" + this.getName() + ";" +
this.getCallableSignature()
namespace + ";" + type + ";" + this.getCallableOverride() + ";" + this.getName() + ";" + "("
+ parameterQualifiedTypeNamesToString() + ")"
)
}
}