mirror of
https://github.com/github/codeql.git
synced 2026-02-09 03:31:06 +01:00
QL: Add ql/missing-qldoc query.
This commit is contained in:
25
ql/src/queries/style/docs/MissingQLDoc.ql
Normal file
25
ql/src/queries/style/docs/MissingQLDoc.ql
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @name Missing QLDoc.
|
||||
* @description Library classes should have QLDoc.
|
||||
* @kind problem
|
||||
* @problem.severity recommendation
|
||||
* @id ql/missing-qldoc
|
||||
* @tags maintainability
|
||||
* @precision high
|
||||
*/
|
||||
|
||||
import ql
|
||||
|
||||
from File f, Class c
|
||||
where
|
||||
f = c.getLocation().getFile() and
|
||||
not exists(c.getQLDoc()) and // no QLDoc
|
||||
f.getExtension() = "qll" and // in a library
|
||||
not c.isPrivate() and // class is public
|
||||
not exists(Module m |
|
||||
m.getAMember*() = c and
|
||||
m.isPrivate() // modules containing the class are public
|
||||
) and
|
||||
not exists(c.getAliasType()) and // class is not just an alias
|
||||
not f.getParentContainer*().getBaseName().toLowerCase() = ["internal", "experimental", "test"] // exclusions
|
||||
select c, "This library class should have QLDoc."
|
||||
Reference in New Issue
Block a user