Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (25 sloc) 1.17 KB
(: Finds methods with missing Update/doUpdate after ForUpdate statement :)
(: @Language Xpp :)
(: @Author :)
<Diagnostics Category='Best practice' href='' Version='1.0'>
for $a in /*
for $m in $a/Method
for $q in $m//Query
where $q/data(SelectionHints) = "ForUpdate"
let $obj := $q/data(@BufferName)
where not(fn:exists($m//QualifiedCall[@MethodName = ("doUpdate", "update", "delete", "doDelete", "write")]/SimpleQualifier[@Name = $obj]))
<Message>This method contains a "select forupdate" statement, but does not perform the corresponding write operation. Review the code to make sure a call to an update, delete, or write method is not missing.</Message>
You can’t perform that action at this time.