File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 1313 */
1414
1515import python
16- private import LegacyPointsTo
16+ private import semmle.python.dataflow.new.internal.DataFlowDispatch
1717
1818predicate fewer_than_two_public_methods ( Class cls , int methods ) {
1919 ( methods = 0 or methods = 1 ) and
@@ -25,13 +25,8 @@ predicate does_not_define_special_method(Class cls) {
2525}
2626
2727predicate 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
28+ not exists ( getADirectSubclass ( c ) ) and
29+ not exists ( getADirectSuperclass ( c ) ) and
3530 not exists ( Expr base | base = c .getABase ( ) |
3631 not base instanceof Name or base .( Name ) .getId ( ) != "object"
3732 )
You can’t perform that action at this time.
0 commit comments