Skip to content

Commit b9d0a60

Browse files
committed
C#: Addressed review comments from hvitved
1 parent a3ca9ad commit b9d0a60

File tree

7 files changed

+21
-26
lines changed

7 files changed

+21
-26
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ module Public {
131131
not exists(getComponentSpecificCsv(sc))
132132
}
133133

134-
/** Gets a textual representation of this component used for flow summaries */
134+
/** Gets a textual representation of this component used for flow summaries. */
135135
private string getComponentCsv(SummaryComponent sc) {
136136
result = getComponentSpecificCsv(sc)
137137
or
@@ -1016,7 +1016,7 @@ module Private {
10161016
/**
10171017
* A query predicate for outputting flow summaries in semi-colon separated format in QL tests.
10181018
* The syntax is: "namespace;type;overrides;name;signature;ext;inputspec;outputspec;kind",
1019-
* ext is hardcoded to empty
1019+
* ext is hardcoded to empty.
10201020
*/
10211021
query predicate summary(string csv) {
10221022
exists(

csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImplSpecific.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ SummaryComponent interpretComponentSpecific(string c) {
138138
)
139139
}
140140

141-
/** Gets the textual representation of the content in the format used for flow summaries */
141+
/** Gets the textual representation of the content in the format used for flow summaries. */
142142
private string getContentSpecificCsv(Content c) {
143143
c = TElementContent() and result = "Element"
144144
or
@@ -147,14 +147,14 @@ private string getContentSpecificCsv(Content c) {
147147
exists(Property p | c = TPropertyContent(p) and result = "Property[" + p.getQualifiedName() + "]")
148148
}
149149

150-
/** Gets the textual representation of a summary component in the format used for flow summaries */
150+
/** Gets the textual representation of a summary component in the format used for flow summaries. */
151151
string getComponentSpecificCsv(SummaryComponent sc) {
152152
exists(Content c | sc = TContentSummaryComponent(c) and result = getContentSpecificCsv(c))
153153
or
154-
exists(ReturnKind jrk |
155-
sc = TReturnSummaryComponent(jrk) and
156-
result = "ReturnValue[" + jrk + "]" and
157-
not jrk instanceof NormalReturnKind
154+
exists(ReturnKind rk |
155+
sc = TReturnSummaryComponent(rk) and
156+
result = "ReturnValue[" + rk + "]" and
157+
not rk instanceof NormalReturnKind
158158
)
159159
}
160160

csharp/ql/test/shared/FlowSummaries.qll

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,17 @@ import semmle.code.csharp.dataflow.FlowSummary
22
import semmle.code.csharp.dataflow.internal.FlowSummaryImpl::Private::TestOutput
33

44
abstract class IncludeSummarizedCallable extends RelevantSummarizedCallable {
5-
/** Gets the qualified parameter types of this callable as a comma-separated string */
5+
/** Gets the qualified parameter types of this callable as a comma-separated string. */
66
private string parameterQualifiedTypeNamesToString() {
77
result =
8-
concat(int i |
9-
exists(this.getParameter(i))
8+
concat(Parameter p, int i |
9+
p = this.getParameter(i)
1010
|
11-
this.getParameter(i).getType().getQualifiedName(), ", " order by i
11+
p.getType().getQualifiedName(), ", " order by i
1212
)
1313
}
1414

15-
/* Gets a string representation of the input type signature of callable */
16-
private string getCallableSignature() {
17-
result = "(" + parameterQualifiedTypeNamesToString() + ")"
18-
}
19-
20-
/* Gets a string representing, whether the declaring type is an interface */
15+
/* Gets a string representing, whether the declaring type is an interface. */
2116
private string getCallableOverride() {
2217
if
2318
this.getDeclaringType() instanceof Interface or
@@ -31,8 +26,8 @@ abstract class IncludeSummarizedCallable extends RelevantSummarizedCallable {
3126
exists(string namespace, string type |
3227
this.getDeclaringType().hasQualifiedName(namespace, type) and
3328
result =
34-
namespace + ";" + type + ";" + this.getCallableOverride() + ";" + this.getName() + ";" +
35-
this.getCallableSignature()
29+
namespace + ";" + type + ";" + this.getCallableOverride() + ";" + this.getName() + ";" + "("
30+
+ parameterQualifiedTypeNamesToString() + ")"
3631
)
3732
}
3833
}

java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ module Public {
131131
not exists(getComponentSpecificCsv(sc))
132132
}
133133

134-
/** Gets a textual representation of this component used for flow summaries */
134+
/** Gets a textual representation of this component used for flow summaries. */
135135
private string getComponentCsv(SummaryComponent sc) {
136136
result = getComponentSpecificCsv(sc)
137137
or
@@ -1016,7 +1016,7 @@ module Private {
10161016
/**
10171017
* A query predicate for outputting flow summaries in semi-colon separated format in QL tests.
10181018
* The syntax is: "namespace;type;overrides;name;signature;ext;inputspec;outputspec;kind",
1019-
* ext is hardcoded to empty
1019+
* ext is hardcoded to empty.
10201020
*/
10211021
query predicate summary(string csv) {
10221022
exists(

java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImplSpecific.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private string getContentSpecificCsv(Content c) {
9191
c instanceof MapValueContent and result = "MapValue"
9292
}
9393

94-
/** Gets the textual representation of the content in the format used for flow summaries */
94+
/** Gets the textual representation of the content in the format used for flow summaries. */
9595
string getComponentSpecificCsv(SummaryComponent sc) {
9696
exists(Content c | sc = TContentSummaryComponent(c) and result = getContentSpecificCsv(c))
9797
}

ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ module Public {
131131
not exists(getComponentSpecificCsv(sc))
132132
}
133133

134-
/** Gets a textual representation of this component used for flow summaries */
134+
/** Gets a textual representation of this component used for flow summaries. */
135135
private string getComponentCsv(SummaryComponent sc) {
136136
result = getComponentSpecificCsv(sc)
137137
or
@@ -1016,7 +1016,7 @@ module Private {
10161016
/**
10171017
* A query predicate for outputting flow summaries in semi-colon separated format in QL tests.
10181018
* The syntax is: "namespace;type;overrides;name;signature;ext;inputspec;outputspec;kind",
1019-
* ext is hardcoded to empty
1019+
* ext is hardcoded to empty.
10201020
*/
10211021
query predicate summary(string csv) {
10221022
exists(

ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImplSpecific.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ SummaryComponent interpretComponentSpecific(string c) {
6969
result = FlowSummary::SummaryComponent::argument(any(int i | i >= 0))
7070
}
7171

72-
/** Gets the textual representation of a summary component in the format used for flow summaries */
72+
/** Gets the textual representation of a summary component in the format used for flow summaries. */
7373
string getComponentSpecificCsv(SummaryComponent sc) {
7474
sc = TArgumentSummaryComponent(-2) and result = "BlockArgument"
7575
}

0 commit comments

Comments
 (0)