Skip to content

Commit b8e744e

Browse files
committed
Python: Document Class.qll.
1 parent 25122c9 commit b8e744e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

python/ql/src/semmle/python/Class.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* Provides classes representing Python classes.
3+
*/
4+
15
import python
26

37
/**
@@ -37,6 +41,7 @@ class ClassExpr extends ClassExpr_ {
3741
result = this.getStarargs()
3842
}
3943

44+
/** Gets a call corresponding to a decorator of this class definition. */
4045
Call getADecoratorCall() {
4146
result.getArg(0) = this or
4247
result.getArg(0) = this.getADecoratorCall()
@@ -114,6 +119,7 @@ class Class extends Class_, Scope, AstNode {
114119
/** Gets the name used to define this class */
115120
override string getName() { result = Class_.super.getName() }
116121

122+
/** Whether this expression may have a side effect (as determined purely from its syntax). */
117123
predicate hasSideEffects() { any() }
118124

119125
/** Whether this is probably a mixin (has 'mixin' or similar in name or docstring) */
@@ -129,6 +135,7 @@ class Class extends Class_, Scope, AstNode {
129135

130136
override AstNode getAChildNode() { result = this.getAStmt() }
131137

138+
/** Gets a decorator of this class. */
132139
Expr getADecorator() { result = this.getParent().getADecorator() }
133140

134141
/** Gets the metaclass expression */

0 commit comments

Comments
 (0)