We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1abb8ad commit 8017faeCopy full SHA for 8017fae
java/ql/src/Likely Bugs/Frameworks/JUnit/ExcessivePublicMethodMocking.ql
@@ -65,7 +65,7 @@ class MockitoMockingMethodCall extends MethodCall {
65
from JUnit4TestMethod testMethod, ClassOrInterface mockedClassOrInterface
66
where
67
exists(MockitoMockCall mockCall |
68
- mockCall.getParent+() = testMethod.getBody().getAStmt() and
+ mockCall.getEnclosingCallable() = testMethod and
69
mockedClassOrInterface = mockCall.getMockedType() and
70
// Only flag classes with multiple public methods (2 or more)
71
strictcount(Method m | m = mockedClassOrInterface.getAMethod() and m.isPublic()) > 1 and
0 commit comments