Skip to content

Commit af7f532

Browse files
authored
Python: Fix up a bunch of function QLDoc
1 parent b35718e commit af7f532

File tree

45 files changed

+160
-161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+160
-161
lines changed

cpp/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ abstract class InlineExpectationsTest extends string {
124124
abstract predicate hasActualResult(Location location, string element, string tag, string value);
125125

126126
/**
127-
* Like `hasActualResult`, but returns results that do not require a matching annotation.
127+
* Holds similarly to `hasActualResult`, but returns results that do not require a matching annotation.
128128
* A failure will still arise if there is an annotation that does not match any results, but not vice versa.
129129
* Override this predicate to specify optional results.
130130
*/

csharp/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ abstract class InlineExpectationsTest extends string {
124124
abstract predicate hasActualResult(Location location, string element, string tag, string value);
125125

126126
/**
127-
* Like `hasActualResult`, but returns results that do not require a matching annotation.
127+
* Holds similarly to `hasActualResult`, but returns results that do not require a matching annotation.
128128
* A failure will still arise if there is an annotation that does not match any results, but not vice versa.
129129
* Override this predicate to specify optional results.
130130
*/

java/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ abstract class InlineExpectationsTest extends string {
124124
abstract predicate hasActualResult(Location location, string element, string tag, string value);
125125

126126
/**
127-
* Like `hasActualResult`, but returns results that do not require a matching annotation.
127+
* Holds similarly to `hasActualResult`, but returns results that do not require a matching annotation.
128128
* A failure will still arise if there is an annotation that does not match any results, but not vice versa.
129129
* Override this predicate to specify optional results.
130130
*/

python/ql/lib/semmle/python/Comment.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class CommentBlock extends @py_comment {
5959
/** Gets a textual representation of this element. */
6060
string toString() { result = "Comment block" }
6161

62-
/** The length of this comment block (in comments) */
62+
/** Gets the length of this comment block (in comments) */
6363
int length() { result = max(int i | comment_block_part(this, _, i)) }
6464

6565
/**

python/ql/lib/semmle/python/Comparisons.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,22 @@ class CompareOp extends int {
7676
}
7777
}
7878

79-
/** The `CompareOp` for "equals". */
79+
/** Gets the `CompareOp` for "equals". */
8080
CompareOp eq() { result = 1 }
8181

82-
/** The `CompareOp` for "not equals". */
82+
/** Gets the `CompareOp` for "not equals". */
8383
CompareOp ne() { result = 2 }
8484

85-
/** The `CompareOp` for "less than". */
85+
/** Gets the `CompareOp` for "less than". */
8686
CompareOp lt() { result = 3 }
8787

88-
/** The `CompareOp` for "less than or equal to". */
88+
/** Gets the `CompareOp` for "less than or equal to". */
8989
CompareOp le() { result = 4 }
9090

91-
/** The `CompareOp` for "greater than". */
91+
/** Gets the `CompareOp` for "greater than". */
9292
CompareOp gt() { result = 5 }
9393

94-
/** The `CompareOp` for "greater than or equal to". */
94+
/** Gets the `CompareOp` for "greater than or equal to". */
9595
CompareOp ge() { result = 6 }
9696

9797
/* Workaround precision limits in floating point numbers */

python/ql/lib/semmle/python/Exprs.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ class Unicode extends StrConst {
446446
}
447447

448448
/**
449+
* Gets the quoted representation fo this string.
450+
*
449451
* The extractor puts quotes into the name of each string (to prevent "0" clashing with 0).
450452
* The following predicate help us match up a string/byte literals in the source
451453
* which the equivalent object.

python/ql/lib/semmle/python/Flow.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class ControlFlowNode extends @py_flow_node {
155155
/** Whether this flow node is the first in its scope */
156156
predicate isEntryNode() { py_scope_flow(this, _, -1) }
157157

158-
/** The value that this ControlFlowNode points-to. */
158+
/** Gets the value that this ControlFlowNode points-to. */
159159
predicate pointsTo(Value value) { this.pointsTo(_, value, _) }
160160

161161
/** Gets the value that this ControlFlowNode points-to. */
@@ -164,10 +164,10 @@ class ControlFlowNode extends @py_flow_node {
164164
/** Gets a value that this ControlFlowNode may points-to. */
165165
Value inferredValue() { this.pointsTo(_, result, _) }
166166

167-
/** The value and origin that this ControlFlowNode points-to. */
167+
/** Gets the value and origin that this ControlFlowNode points-to. */
168168
predicate pointsTo(Value value, ControlFlowNode origin) { this.pointsTo(_, value, origin) }
169169

170-
/** The value and origin that this ControlFlowNode points-to, given the context. */
170+
/** Gets the value and origin that this ControlFlowNode points-to, given the context. */
171171
predicate pointsTo(Context context, Value value, ControlFlowNode origin) {
172172
PointsTo::pointsTo(this, context, value, origin)
173173
}

python/ql/lib/semmle/python/Function.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import python
55
* It is the syntactic entity that is compiled to a code object.
66
*/
77
class Function extends Function_, Scope, AstNode {
8-
/** The expression defining this function */
8+
/** Gets the expression defining this function */
99
CallableExpr getDefinition() { result = this.getParent() }
1010

1111
/**
12-
* The scope in which this function occurs, will be a class for a method,
12+
* Gets the scope in which this function occurs. This will be a class for a method,
1313
* another function for nested functions, generator expressions or comprehensions,
1414
* or a module for a plain function.
1515
*/
@@ -183,8 +183,8 @@ class FunctionDef extends Assign {
183183
override Stmt getLastStatement() { result = this.getDefinedFunction().getLastStatement() }
184184
}
185185

186+
/** A function that uses 'fast' locals, stored in the frame not in a dictionary. */
186187
class FastLocalsFunction extends Function {
187-
/** A function that uses 'fast' locals, stored in the frame not in a dictionary. */
188188
FastLocalsFunction() {
189189
not exists(ImportStar i | i.getScope() = this) and
190190
not exists(Exec e | e.getScope() = this)

python/ql/lib/semmle/python/Import.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class ImportExpr extends ImportExpr_ {
3535
}
3636

3737
/**
38+
* Gets the level of this import.
39+
*
3840
* The language specifies level as -1 if relative imports are to be tried first, 0 for absolute imports,
3941
* and level > 0 for explicit relative imports.
4042
*/

python/ql/lib/semmle/python/Metrics.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class FunctionMetrics extends Function {
1818
int getNumberOfLinesOfDocStrings() { py_docstringlines(this, result) }
1919

2020
/**
21-
* Cyclomatic complexity:
21+
* Gets the cyclomatic complexity of the function:
2222
* The number of linearly independent paths through the source code.
2323
* Computed as E - N + 2P,
2424
* where
@@ -130,13 +130,13 @@ class ClassMetrics extends Class {
130130
}
131131

132132
/**
133-
* The afferent coupling of a class is the number of classes that
133+
* Gets the afferent coupling of a class -- the number of classes that
134134
* directly depend on it.
135135
*/
136136
int getAfferentCoupling() { result = count(ClassMetrics t | t.dependsOn(this)) }
137137

138138
/**
139-
* The efferent coupling of a class is the number of classes that
139+
* Gets the efferent coupling of a class -- the number of classes that
140140
* it directly depends on.
141141
*/
142142
int getEfferentCoupling() { result = count(ClassMetrics t | this.dependsOn(t)) }
@@ -273,13 +273,13 @@ class ModuleMetrics extends Module {
273273
int getNumberOfLinesOfDocStrings() { py_docstringlines(this, result) }
274274

275275
/**
276-
* The afferent coupling of a class is the number of classes that
276+
* Gets the afferent coupling of a class -- the number of classes that
277277
* directly depend on it.
278278
*/
279279
int getAfferentCoupling() { result = count(ModuleMetrics t | t.dependsOn(this)) }
280280

281281
/**
282-
* The efferent coupling of a class is the number of classes that
282+
* Gets the efferent coupling of a class -- the number of classes that
283283
* it directly depends on.
284284
*/
285285
int getEfferentCoupling() { result = count(ModuleMetrics t | this.dependsOn(t)) }

0 commit comments

Comments
 (0)