We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
get
CallTargetStats
1 parent 1b224c1 commit 5727fdaCopy full SHA for 5727fda
1 file changed
csharp/ql/src/Telemetry/DatabaseQuality.qll
@@ -32,6 +32,14 @@ module ReportStats<StatsSig Stats> {
32
}
33
34
35
+private predicate isNoSetterPropertyCallInConstructor(PropertyCall c) {
36
+ exists(Property p |
37
+ p = c.getProperty() and
38
+ not exists(Setter a | a = p.getAnAccessor()) and
39
+ c.getEnclosingCallable().(Constructor).getDeclaringType().getASubType*() = p.getDeclaringType()
40
+ )
41
+}
42
+
43
module CallTargetStats implements StatsSig {
44
int getNumberOfOk() { result = count(Call c | exists(c.getTarget())) }
45
@@ -40,7 +48,8 @@ module CallTargetStats implements StatsSig {
48
count(Call c |
49
not exists(c.getTarget()) and
50
not c instanceof DelegateCall and
- not c instanceof DynamicExpr
51
+ not c instanceof DynamicExpr and
52
+ not isNoSetterPropertyCallInConstructor(c)
53
)
54
46
55
0 commit comments