File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,19 +13,19 @@ import python
1313import Definition
1414
1515
16- predicate unused_parameter ( FunctionObject f , LocalVariable v ) {
16+ predicate unused_parameter ( FunctionValue f , LocalVariable v ) {
1717 v .isParameter ( ) and
18- v .getScope ( ) = f .getFunction ( ) and
18+ v .getScope ( ) = f .getScope ( ) and
1919 not name_acceptable_for_unused_variable ( v ) and
2020 not exists ( NameNode u | u .uses ( v ) ) and
2121 not exists ( Name inner , LocalVariable iv | inner .uses ( iv ) and iv .getId ( ) = v .getId ( ) and inner .getScope ( ) .getScope ( ) = v .getScope ( ) )
2222}
2323
24- predicate is_abstract ( FunctionObject func ) {
25- ( ( Name ) func .getFunction ( ) .getADecorator ( ) ) .getId ( ) .matches ( "%abstract%" )
24+ predicate is_abstract ( FunctionValue func ) {
25+ func .getScope ( ) .getADecorator ( ) . ( Name ) .getId ( ) .matches ( "%abstract%" )
2626}
2727
28- from PyFunctionObject f , LocalVariable v
28+ from PythonFunctionValue f , LocalVariable v
2929where v .getId ( ) != "self" and unused_parameter ( f , v ) and not f .isOverridingMethod ( ) and not f .isOverriddenMethod ( ) and
3030not is_abstract ( f )
3131select f , "The parameter '" + v .getId ( ) + "' is never used."
You can’t perform that action at this time.
0 commit comments