C#: Address review comments.

This commit is contained in:
Michael Nebel
2023-02-28 13:21:19 +01:00
parent 4ef866b3a3
commit 51746627d2
2 changed files with 5 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ where
fw.getTarget() = f and
f.isStatic() and
c = fw.getEnclosingCallable() and
not exists(Member m | m = c or m = c.(Accessor).getDeclaration() | m.isStatic()) and
not [c.(Member), c.(Accessor).getDeclaration()].isStatic() and
f.getDeclaringType() = c.getDeclaringType() and
c.fromSource()
select fw.(VariableAccess), "Write to static field from instance method, property or constructor."
select fw.(VariableAccess), "Write to static field from instance method, property, or constructor."

View File

@@ -1,3 +1,3 @@
| StaticFieldWrittenByInstance.cs:15:9:15:19 | access to field staticField | Write to static field from instance method, property or constructor. |
| StaticFieldWrittenByInstance.cs:26:9:26:19 | access to field staticField | Write to static field from instance method, property or constructor. |
| StaticFieldWrittenByInstance.cs:43:37:43:48 | access to field backingField | Write to static field from instance method, property or constructor. |
| StaticFieldWrittenByInstance.cs:15:9:15:19 | access to field staticField | Write to static field from instance method, property, or constructor. |
| StaticFieldWrittenByInstance.cs:26:9:26:19 | access to field staticField | Write to static field from instance method, property, or constructor. |
| StaticFieldWrittenByInstance.cs:43:37:43:48 | access to field backingField | Write to static field from instance method, property, or constructor. |