Skip to content

Commit 486efba

Browse files
committed
refactor based on review
1 parent 172c5cc commit 486efba

File tree

1 file changed

+4
-12
lines changed
  • javascript/ql/src/semmle/javascript/frameworks

1 file changed

+4
-12
lines changed

javascript/ql/src/semmle/javascript/frameworks/jQuery.qll

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -303,28 +303,22 @@ private module JQueryClientRequest {
303303
.getParameter(0))
304304
or
305305
result = getAnAjaxCallbackDataNode(this)
306-
or
307-
result = getAResponseNodeFromAnXHRObject(getAnXHRObject(this))
308306
)
309307
}
310308
}
311309

312310
/**
313-
* Gets a response data node from a call to a method on jqXHR Object.
311+
* Gets a response data node from a call to a method on jqXHR Object `request`.
314312
*/
315313
private DataFlow::Node getAnAjaxCallbackDataNode(ClientRequest::Range request) {
316314
result =
317315
request
318316
.getAMemberCall(any(string s | s = "done" or s = "then"))
319317
.getCallback(0)
320318
.getParameter(0)
321-
}
322-
323-
/**
324-
* Gets a `jqXHR` object from a call to the `fail(..)` method on jqXHR Object.
325-
*/
326-
private DataFlow::SourceNode getAnXHRObject(ClientRequest::Range request) {
327-
result = request.getAMemberCall("fail").getCallback(0).getParameter(0)
319+
or
320+
result =
321+
getAResponseNodeFromAnXHRObject(request.getAMemberCall("fail").getCallback(0).getParameter(0))
328322
}
329323

330324
/**
@@ -400,8 +394,6 @@ private module JQueryClientRequest {
400394
result = getCallback([getNumArgument() - 2 .. getNumArgument() - 1]).getParameter(0)
401395
or
402396
result = getAnAjaxCallbackDataNode(this)
403-
or
404-
result = getAResponseNodeFromAnXHRObject(getAnXHRObject(this))
405397
)
406398
}
407399
}

0 commit comments

Comments
 (0)