mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
PY: fix some ql/non-doc-block warnings
This commit is contained in:
@@ -299,7 +299,7 @@ class ControlFlowNode extends @py_flow_node {
|
||||
exists(BasicBlock b, int i, int j | this = b.getNode(i) and other = b.getNode(j) and i < j)
|
||||
}
|
||||
|
||||
/* Holds if this CFG node is a branch */
|
||||
/** Holds if this CFG node is a branch */
|
||||
predicate isBranch() { py_true_successors(this, _) or py_false_successors(this, _) }
|
||||
|
||||
ControlFlowNode getAChild() { result = this.getExprChild(this.getBasicBlock()) }
|
||||
|
||||
@@ -991,7 +991,7 @@ int iterable_unpacking_descent(SequenceNode left_parent, ControlFlowNode left_de
|
||||
}
|
||||
|
||||
module Implementation {
|
||||
/* A call that returns a copy (or similar) of the argument */
|
||||
/** Holds if `tonode` is a call that returns a copy (or similar) of the argument `fromnode` */
|
||||
predicate copyCall(ControlFlowNode fromnode, CallNode tonode) {
|
||||
tonode.getFunction().(AttrNode).getObject("copy") = fromnode
|
||||
or
|
||||
|
||||
@@ -2,7 +2,7 @@ import semmle.python.dataflow.TaintTracking
|
||||
private import semmle.python.objects.ObjectInternal
|
||||
import semmle.python.dataflow.Implementation
|
||||
|
||||
/* Backwards compatibility with config-less taint-tracking */
|
||||
/** A configuration that provides backwards compatibility with config-less taint-tracking */
|
||||
private class LegacyConfiguration extends TaintTracking::Configuration {
|
||||
LegacyConfiguration() {
|
||||
/* A name that won't be accidentally chosen by users */
|
||||
|
||||
@@ -158,13 +158,13 @@ private predicate defn_of_instance_attribute(Assign asgn, Class c, string name)
|
||||
)
|
||||
}
|
||||
|
||||
/* Whether asgn defines an attribute of a class */
|
||||
/** Holds if asgn defines an attribute of a class */
|
||||
private predicate defn_of_class_attribute(Assign asgn, Class c, string name) {
|
||||
asgn.getScope() = c and
|
||||
asgn.getATarget().(Name).getId() = name
|
||||
}
|
||||
|
||||
/* Holds if `value` is a value assigned to the `name`d attribute of module `m`. */
|
||||
/** Holds if `value` is a value assigned to the `name`d attribute of module `m`. */
|
||||
private predicate defn_of_module_attribute(ControlFlowNode value, Module m, string name) {
|
||||
exists(DefinitionNode def |
|
||||
def.getScope() = m and
|
||||
|
||||
@@ -18,7 +18,7 @@ private import semmle.python.types.Builtins
|
||||
|
||||
class ObjectSource = Object;
|
||||
|
||||
/* Aliases for scopes */
|
||||
/** An alias for Function used for scopes */
|
||||
class FunctionScope = Function;
|
||||
|
||||
class ClassScope = Class;
|
||||
|
||||
@@ -120,7 +120,7 @@ int version_tuple_compare(Object t) {
|
||||
version_tuple_value(t) > major_minor() and result = 1
|
||||
}
|
||||
|
||||
/* Holds if `cls` is a new-style class if it were to have no explicit base classes */
|
||||
/** Holds if `cls` is a new-style class if it were to have no explicit base classes */
|
||||
predicate baseless_is_new_style(ClassObject cls) {
|
||||
cls.isBuiltin()
|
||||
or
|
||||
|
||||
@@ -2395,7 +2395,7 @@ module Types {
|
||||
)
|
||||
}
|
||||
|
||||
/* Holds if type inference failed to compute the full class hierarchy for this class for the reason given. */
|
||||
/** Holds if type inference failed to compute the full class hierarchy for this class for the reason given. */
|
||||
private predicate failedInference(ClassObjectInternal cls, string reason, int priority) {
|
||||
strictcount(cls.(PythonClassObjectInternal).getScope().getADecorator()) > 1 and
|
||||
reason = "Multiple decorators" and
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import python
|
||||
|
||||
/* A call that returns a copy (or similar) of the argument */
|
||||
/** A call that returns a copy (or similar) of the argument */
|
||||
deprecated predicate copy_call(ControlFlowNode fromnode, CallNode tonode) {
|
||||
tonode.getFunction().(AttrNode).getObject("copy") = fromnode
|
||||
or
|
||||
|
||||
@@ -166,7 +166,7 @@ class ClassObject extends Object {
|
||||
not this.failedInference()
|
||||
}
|
||||
|
||||
/* Whether this class is abstract. */
|
||||
/** Holds if this class is abstract. */
|
||||
predicate isAbstract() {
|
||||
this.getMetaClass() = theAbcMetaClassObject()
|
||||
or
|
||||
|
||||
@@ -158,11 +158,11 @@ private predicate commented_out_code_block(Comment start, Comment end) {
|
||||
not commented_out_code(non_empty_following(end))
|
||||
}
|
||||
|
||||
/* A single line comment that appears to be commented out code */
|
||||
/** A single line comment that appears to be commented out code */
|
||||
class CommentedOutCodeLine extends Comment {
|
||||
CommentedOutCodeLine() { exists(CommentedOutCodeBlock b | b.contains(this)) }
|
||||
|
||||
/* Whether this commented-out code line is likely to be example code embedded in a larger comment. */
|
||||
/** Holds if this commented-out code line is likely to be example code embedded in a larger comment. */
|
||||
predicate maybeExampleCode() {
|
||||
exists(CommentedOutCodeBlock block |
|
||||
block.contains(this) and
|
||||
|
||||
@@ -66,7 +66,7 @@ predicate passes_open_files(Variable v, ControlFlowNode test, boolean sense) {
|
||||
)
|
||||
}
|
||||
|
||||
/* Helper for `def_is_open` to give better join order */
|
||||
// Helper for `def_is_open` to give better join order
|
||||
private predicate passes_open_files(PyEdgeRefinement refinement) {
|
||||
passes_open_files(refinement.getSourceVariable(), refinement.getPredecessor().getLastNode(),
|
||||
refinement.getSense())
|
||||
|
||||
Reference in New Issue
Block a user