Improve ql code quality

This commit is contained in:
Tamas Vajk
2025-03-10 11:06:35 +01:00
parent 6512ed9429
commit 3d2a72341b

View File

@@ -47,7 +47,7 @@ class LikelyJunitTest extends Method {
(
this.getName().matches("JUnit%") or
this.getName().matches("test%") or
this.getAnAnnotation().toString().matches("%Test")
this.getAnAnnotation().getType().getName().matches("%Test")
)
}
}
@@ -83,7 +83,7 @@ where
//permit comment lines explaining why this is empty
m.getNumberOfCommentLines() = 0 and
//permit a javadoc above as well as sufficient reason to leave empty
not exists(Javadoc jd | m.getDoc().getJavadoc() = jd) and
not exists(m.getDoc().getJavadoc()) and
//annotated methods are considered compliant
not exists(m.getAnAnnotation()) and
//default methods are not abstract, but are considered compliant