This commit is contained in:
Michael Nebel 2023-02-28 13:21:19 +01:00
Родитель 4ef866b3a3
Коммит 51746627d2
2 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -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."

Просмотреть файл

@ -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. |