Skip to content

Commit 76b1bbc

Browse files
authored
Merge pull request #565 from markshannon/python-analysis-queries-qhelp
Python: Delete some misleading qhelp and rename a couple of queries.
2 parents a3a5829 + 9aa59fd commit 76b1bbc

File tree

9 files changed

+19
-49
lines changed

9 files changed

+19
-49
lines changed

python/ql/src/analysis/ImportFailure.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ where not ie.refersTo(_) and
6868
guard.controls(ie.getAFlowNode().getBasicBlock(), true)
6969
)
7070

71-
select ie, "Unable to resolve import of '" + ie.getImportedModuleName() + "'."
71+
select ie, "Unable to resolve import of '" + ie.getImportedModuleName() + "'."

python/ql/src/analysis/KeyPointsToFailure.qhelp

Lines changed: 0 additions & 11 deletions
This file was deleted.

python/ql/src/analysis/KeyPointsToFailure.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/**
2-
* @name Key "points-to" fails for expression.
2+
* @name Key points-to fails for expression.
33
* @description Expression does not "point-to" an object which prevents further points-to analysis.
44
* @kind problem
55
* @problem.severity info
66
* @id py/key-points-to-failure
7+
* @deprecated
78
*/
89

910
import python

python/ql/src/analysis/PointsToFailure.qhelp

Lines changed: 0 additions & 11 deletions
This file was deleted.

python/ql/src/analysis/PointsToFailure.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/**
2-
* @name "points-to" fails for expression.
2+
* @name points-to fails for expression.
33
* @description Expression does not "point-to" an object which prevents type inference.
44
* @kind problem
55
* @id py/points-to-failure
66
* @problem.severity info
7-
* @tags reliability
7+
* @tags debug
8+
* @deprecated
89
*/
910

1011
import python

python/ql/src/analysis/TypeHierarchyFailure.qhelp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
"qhelp.dtd">
44
<qhelp>
55
<overview>
6-
<p>In order to analyse uses of a class, all its attributes need to be known. Without the full inheritance hierarchy this is impossible.
7-
This is an informational query only.
6+
<p>In order to analyze uses of a class, all its attributes need to be known. Without the full inheritance hierarchy this is impossible.
7+
This query finds classes where type inference fails and gives some indication as to why that failure occurred.
88
</p>
99

1010
<p>
1111
This is an informational query only, this query depends on points-to and type inference.
12+
Unlike normal queries it does not indicate any problem with the program being analyzed.
1213
</p>
1314

15+
1416
</overview>
1517
</qhelp>
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/**
22
* @name Inheritance hierarchy cannot be inferred for class
3-
* @description Inability to infer inheritance hierarchy cannot be inferred for class will impair analysis
3+
* @description Inability to infer the inheritance hierarchy for a class will impair analysis.
44
* @id py/failed-inheritance-inference
55
* @kind problem
66
* @problem.severity info
7+
* @tags debug
78
*/
8-
9+
910
import python
1011

1112

12-
from Class cls
13-
where not exists(ClassObject c | c.getPyClass() = cls)
14-
or
15-
exists(ClassObject c | c.getPyClass() = cls | c.failedInference())
16-
select cls, "Inference of class hierarchy failed for class."
13+
from Class cls, string reason
14+
where
15+
exists(ClassObject c | c.getPyClass() = cls | c.failedInference(reason))
16+
select cls, "Inference of class hierarchy failed for class '" + cls.getName() + "': " + reason + "."

python/ql/src/analysis/TypeInferenceFailure.qhelp

Lines changed: 0 additions & 13 deletions
This file was deleted.

python/ql/src/analysis/TypeInferenceFailure.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
* @kind problem
55
* @problem.severity info
66
* @id py/type-inference-failure
7+
* @deprecated
78
*/
89
import python
910

1011

11-
from ControlFlowNode f, Object o
12+
from ControlFlowNode f, Object o
1213
where f.refersTo(o) and
1314
not exists(ClassObject c | f.refersTo(o, c, _))
1415
select o, "Type inference fails for 'object'."

0 commit comments

Comments
 (0)