We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 933af14 commit 3834763Copy full SHA for 3834763
1 file changed
python/ql/src/Classes/UselessClass.ql
@@ -13,7 +13,7 @@
13
*/
14
15
import python
16
-private import LegacyPointsTo
+private import semmle.python.dataflow.new.internal.DataFlowDispatch
17
18
predicate fewer_than_two_public_methods(Class cls, int methods) {
19
(methods = 0 or methods = 1) and
@@ -25,13 +25,8 @@ predicate does_not_define_special_method(Class cls) {
25
}
26
27
predicate no_inheritance(Class c) {
28
- not exists(ClassValue cls, ClassValue other |
29
- cls.getScope() = c and
30
- other != ClassValue::object()
31
- |
32
- other.getABaseType() = cls or
33
- cls.getABaseType() = other
34
- ) and
+ not exists(getADirectSubclass(c)) and
+ not exists(getADirectSuperclass(c)) and
35
not exists(Expr base | base = c.getABase() |
36
not base instanceof Name or base.(Name).getId() != "object"
37
)
0 commit comments