Java: Use strictcount instead of count for method counting

Co-authored-by: michaelnebel <michaelnebel@github.com>
This commit is contained in:
Napalys Klicius
2025-08-26 08:41:33 +00:00
parent b271f1fcd0
commit 1abb8ad54a

View File

@@ -68,7 +68,7 @@ where
mockCall.getParent+() = testMethod.getBody().getAStmt() and
mockedClassOrInterface = mockCall.getMockedType() and
// Only flag classes with multiple public methods (2 or more)
count(Method m | m = mockedClassOrInterface.getAMethod() and m.isPublic()) > 1 and
strictcount(Method m | m = mockedClassOrInterface.getAMethod() and m.isPublic()) > 1 and
forex(Method method | method = mockedClassOrInterface.getAMethod() and method.isPublic() |
exists(MockitoMockingMethodCall mockedMethod |
mockedMethod.getMockitoMockCall() = mockCall and