Skip to content

Commit 1abb8ad

Browse files
Napalysmichaelnebel
andcommitted
Java: Use strictcount instead of count for method counting
Co-authored-by: michaelnebel <[email protected]>
1 parent b271f1f commit 1abb8ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

java/ql/src/Likely Bugs/Frameworks/JUnit/ExcessivePublicMethodMocking.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ where
6868
mockCall.getParent+() = testMethod.getBody().getAStmt() and
6969
mockedClassOrInterface = mockCall.getMockedType() and
7070
// Only flag classes with multiple public methods (2 or more)
71-
count(Method m | m = mockedClassOrInterface.getAMethod() and m.isPublic()) > 1 and
71+
strictcount(Method m | m = mockedClassOrInterface.getAMethod() and m.isPublic()) > 1 and
7272
forex(Method method | method = mockedClassOrInterface.getAMethod() and method.isPublic() |
7373
exists(MockitoMockingMethodCall mockedMethod |
7474
mockedMethod.getMockitoMockCall() = mockCall and

0 commit comments

Comments
 (0)