Skip to content

Commit d264785

Browse files
authored
Merge pull request github#12564 from hvitved/ruby/remove-redundant-super-prefixes
Ruby: Remove some redundant `super` type qualifiers
2 parents 75746cb + d146d81 commit d264785

File tree

2 files changed

+64
-68
lines changed

2 files changed

+64
-68
lines changed

ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ module ExprNodes {
282282

283283
override AssignExprChildMapping e;
284284

285-
final override AssignExpr getExpr() { result = ExprCfgNode.super.getExpr() }
285+
final override AssignExpr getExpr() { result = super.getExpr() }
286286

287287
/** Gets the LHS of this assignment. */
288288
final LhsExprCfgNode getLhs() { e.hasCfgChild(e.getLeftOperand(), this, result) }
@@ -351,7 +351,7 @@ module ExprNodes {
351351

352352
override BlockArgumentChildMapping e;
353353

354-
final override BlockArgument getExpr() { result = ExprCfgNode.super.getExpr() }
354+
final override BlockArgument getExpr() { result = super.getExpr() }
355355

356356
/** Gets the value of this block argument. */
357357
final ExprCfgNode getValue() { e.hasCfgChild(e.getValue(), this, result) }
@@ -426,7 +426,7 @@ module ExprNodes {
426426

427427
override CaseExprChildMapping e;
428428

429-
final override CaseExpr getExpr() { result = ExprCfgNode.super.getExpr() }
429+
final override CaseExpr getExpr() { result = super.getExpr() }
430430

431431
/** Gets the expression being compared, if any. */
432432
final ExprCfgNode getValue() { e.hasCfgChild(e.getValue(), this, result) }
@@ -660,7 +660,7 @@ module ExprNodes {
660660

661661
override ConditionalExprChildMapping e;
662662

663-
final override ConditionalExpr getExpr() { result = ExprCfgNode.super.getExpr() }
663+
final override ConditionalExpr getExpr() { result = super.getExpr() }
664664

665665
/** Gets the condition expression. */
666666
final ExprCfgNode getCondition() { e.hasCfgChild(e.getCondition(), this, result) }
@@ -698,7 +698,7 @@ module ExprNodes {
698698

699699
override StmtSequenceChildMapping e;
700700

701-
final override StmtSequence getExpr() { result = ExprCfgNode.super.getExpr() }
701+
final override StmtSequence getExpr() { result = super.getExpr() }
702702

703703
/** Gets the last statement in this sequence, if any. */
704704
final ExprCfgNode getLastStmt() { e.hasCfgChild(e.getLastStmt(), this, result) }
@@ -714,7 +714,7 @@ module ExprNodes {
714714

715715
override ForExprChildMapping e;
716716

717-
final override ForExpr getExpr() { result = ExprCfgNode.super.getExpr() }
717+
final override ForExpr getExpr() { result = super.getExpr() }
718718

719719
/** Gets the value being iterated over. */
720720
final ExprCfgNode getValue() { e.hasCfgChild(e.getValue(), this, result) }
@@ -737,7 +737,7 @@ module ExprNodes {
737737

738738
override PairChildMapping e;
739739

740-
final override Pair getExpr() { result = ExprCfgNode.super.getExpr() }
740+
final override Pair getExpr() { result = super.getExpr() }
741741

742742
/**
743743
* Gets the key expression of this pair.
@@ -756,7 +756,7 @@ module ExprNodes {
756756

757757
override VariableAccess e;
758758

759-
override VariableAccess getExpr() { result = ExprCfgNode.super.getExpr() }
759+
override VariableAccess getExpr() { result = super.getExpr() }
760760

761761
/** Gets the variable that is being accessed. */
762762
Variable getVariable() { result = this.getExpr().getVariable() }
@@ -768,7 +768,7 @@ module ExprNodes {
768768

769769
override VariableReadAccess e;
770770

771-
override VariableReadAccess getExpr() { result = VariableAccessCfgNode.super.getExpr() }
771+
override VariableReadAccess getExpr() { result = super.getExpr() }
772772
}
773773

774774
/** A control-flow node that wraps a `LocalVariableReadAccess` AST expression. */
@@ -792,7 +792,7 @@ module ExprNodes {
792792

793793
override InstanceVariableAccessMapping e;
794794

795-
override InstanceVariableAccess getExpr() { result = ExprCfgNode.super.getExpr() }
795+
override InstanceVariableAccess getExpr() { result = super.getExpr() }
796796

797797
/**
798798
* Gets the synthetic receiver (`self`) of this instance variable access.
@@ -810,7 +810,7 @@ module ExprNodes {
810810

811811
override SelfVariableAccessMapping e;
812812

813-
override SelfVariableAccess getExpr() { result = VariableAccessCfgNode.super.getExpr() }
813+
override SelfVariableAccess getExpr() { result = super.getExpr() }
814814
}
815815

816816
private class VariableWriteAccessChildMapping extends ExprChildMapping, VariableWriteAccess {
@@ -840,7 +840,7 @@ module ExprNodes {
840840

841841
override VariableWriteAccessChildMapping e;
842842

843-
override VariableWriteAccess getExpr() { result = VariableAccessCfgNode.super.getExpr() }
843+
override VariableWriteAccess getExpr() { result = super.getExpr() }
844844
}
845845

846846
private class LocalVariableWriteAccessChildMapping extends VariableWriteAccessChildMapping,
@@ -864,7 +864,7 @@ module ExprNodes {
864864

865865
override ConstantReadAccess e;
866866

867-
final override ConstantReadAccess getExpr() { result = ExprCfgNode.super.getExpr() }
867+
final override ConstantReadAccess getExpr() { result = super.getExpr() }
868868
}
869869

870870
/** A control-flow node that wraps a `ConstantWriteAccess` AST expression. */
@@ -873,7 +873,7 @@ module ExprNodes {
873873

874874
override ConstantWriteAccess e;
875875

876-
final override ConstantWriteAccess getExpr() { result = ExprCfgNode.super.getExpr() }
876+
final override ConstantWriteAccess getExpr() { result = super.getExpr() }
877877
}
878878

879879
/** A control-flow node that wraps an `InstanceVariableReadAccess` AST expression. */
@@ -882,9 +882,7 @@ module ExprNodes {
882882

883883
override string getAPrimaryQlClass() { result = "InstanceVariableReadAccessCfgNode" }
884884

885-
final override InstanceVariableReadAccess getExpr() {
886-
result = InstanceVariableAccessCfgNode.super.getExpr()
887-
}
885+
final override InstanceVariableReadAccess getExpr() { result = super.getExpr() }
888886
}
889887

890888
/** A control-flow node that wraps an `InstanceVariableWriteAccess` AST expression. */
@@ -893,9 +891,7 @@ module ExprNodes {
893891

894892
override string getAPrimaryQlClass() { result = "InstanceVariableWriteAccessCfgNode" }
895893

896-
final override InstanceVariableWriteAccess getExpr() {
897-
result = InstanceVariableAccessCfgNode.super.getExpr()
898-
}
894+
final override InstanceVariableWriteAccess getExpr() { result = super.getExpr() }
899895
}
900896

901897
/** A control-flow node that wraps a `StringInterpolationComponent` AST expression. */

ruby/ql/test/library-tests/frameworks/sinatra/Sinatra.expected

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -43,51 +43,51 @@ filterPatterns
4343
| app.rb:106:3:108:5 | call to before | app.rb:106:10:106:23 | "/protected/*" |
4444
| app.rb:111:3:113:5 | call to after | app.rb:111:9:111:23 | "/create/:slug" |
4545
additionalFlowSteps
46-
| app.rb:85:5:85:9 | [post] self | app.rb:2:22:4:5 | <captured> self |
47-
| app.rb:85:5:85:9 | [post] self | app.rb:10:21:13:5 | <captured> self |
48-
| app.rb:85:5:85:9 | [post] self | app.rb:15:23:18:5 | <captured> self |
49-
| app.rb:85:5:85:9 | [post] self | app.rb:24:26:26:5 | <captured> self |
50-
| app.rb:85:5:85:9 | [post] self | app.rb:37:16:42:5 | <captured> self |
51-
| app.rb:85:5:85:9 | [post] self | app.rb:44:53:46:5 | <captured> self |
52-
| app.rb:85:5:85:9 | [post] self | app.rb:56:32:58:5 | <captured> self |
53-
| app.rb:85:5:85:9 | [post] self | app.rb:60:48:62:5 | <captured> self |
54-
| app.rb:85:5:85:9 | [post] self | app.rb:74:11:77:5 | <captured> self |
55-
| app.rb:85:5:85:9 | [post] self | app.rb:79:11:82:5 | <captured> self |
56-
| app.rb:85:5:85:9 | [post] self | app.rb:89:16:92:5 | <captured> self |
57-
| app.rb:85:5:85:9 | [post] self | app.rb:94:15:96:5 | <captured> self |
58-
| app.rb:86:5:86:11 | [post] self | app.rb:2:22:4:5 | <captured> self |
59-
| app.rb:86:5:86:11 | [post] self | app.rb:10:21:13:5 | <captured> self |
60-
| app.rb:86:5:86:11 | [post] self | app.rb:15:23:18:5 | <captured> self |
61-
| app.rb:86:5:86:11 | [post] self | app.rb:24:26:26:5 | <captured> self |
62-
| app.rb:86:5:86:11 | [post] self | app.rb:37:16:42:5 | <captured> self |
63-
| app.rb:86:5:86:11 | [post] self | app.rb:44:53:46:5 | <captured> self |
64-
| app.rb:86:5:86:11 | [post] self | app.rb:56:32:58:5 | <captured> self |
65-
| app.rb:86:5:86:11 | [post] self | app.rb:60:48:62:5 | <captured> self |
66-
| app.rb:86:5:86:11 | [post] self | app.rb:74:11:77:5 | <captured> self |
67-
| app.rb:86:5:86:11 | [post] self | app.rb:79:11:82:5 | <captured> self |
68-
| app.rb:86:5:86:11 | [post] self | app.rb:89:16:92:5 | <captured> self |
69-
| app.rb:86:5:86:11 | [post] self | app.rb:94:15:96:5 | <captured> self |
70-
| app.rb:103:5:103:9 | [post] self | app.rb:2:22:4:5 | <captured> self |
71-
| app.rb:103:5:103:9 | [post] self | app.rb:10:21:13:5 | <captured> self |
72-
| app.rb:103:5:103:9 | [post] self | app.rb:15:23:18:5 | <captured> self |
73-
| app.rb:103:5:103:9 | [post] self | app.rb:24:26:26:5 | <captured> self |
74-
| app.rb:103:5:103:9 | [post] self | app.rb:37:16:42:5 | <captured> self |
75-
| app.rb:103:5:103:9 | [post] self | app.rb:44:53:46:5 | <captured> self |
76-
| app.rb:103:5:103:9 | [post] self | app.rb:56:32:58:5 | <captured> self |
77-
| app.rb:103:5:103:9 | [post] self | app.rb:60:48:62:5 | <captured> self |
78-
| app.rb:103:5:103:9 | [post] self | app.rb:74:11:77:5 | <captured> self |
79-
| app.rb:103:5:103:9 | [post] self | app.rb:79:11:82:5 | <captured> self |
80-
| app.rb:103:5:103:9 | [post] self | app.rb:89:16:92:5 | <captured> self |
81-
| app.rb:103:5:103:9 | [post] self | app.rb:94:15:96:5 | <captured> self |
82-
| app.rb:103:13:103:22 | [post] self | app.rb:2:22:4:5 | <captured> self |
83-
| app.rb:103:13:103:22 | [post] self | app.rb:10:21:13:5 | <captured> self |
84-
| app.rb:103:13:103:22 | [post] self | app.rb:15:23:18:5 | <captured> self |
85-
| app.rb:103:13:103:22 | [post] self | app.rb:24:26:26:5 | <captured> self |
86-
| app.rb:103:13:103:22 | [post] self | app.rb:37:16:42:5 | <captured> self |
87-
| app.rb:103:13:103:22 | [post] self | app.rb:44:53:46:5 | <captured> self |
88-
| app.rb:103:13:103:22 | [post] self | app.rb:56:32:58:5 | <captured> self |
89-
| app.rb:103:13:103:22 | [post] self | app.rb:60:48:62:5 | <captured> self |
90-
| app.rb:103:13:103:22 | [post] self | app.rb:74:11:77:5 | <captured> self |
91-
| app.rb:103:13:103:22 | [post] self | app.rb:79:11:82:5 | <captured> self |
92-
| app.rb:103:13:103:22 | [post] self | app.rb:89:16:92:5 | <captured> self |
93-
| app.rb:103:13:103:22 | [post] self | app.rb:94:15:96:5 | <captured> self |
46+
| app.rb:85:5:85:9 | [post] self | app.rb:2:22:4:5 | <captured entry> self |
47+
| app.rb:85:5:85:9 | [post] self | app.rb:10:21:13:5 | <captured entry> self |
48+
| app.rb:85:5:85:9 | [post] self | app.rb:15:23:18:5 | <captured entry> self |
49+
| app.rb:85:5:85:9 | [post] self | app.rb:24:26:26:5 | <captured entry> self |
50+
| app.rb:85:5:85:9 | [post] self | app.rb:37:16:42:5 | <captured entry> self |
51+
| app.rb:85:5:85:9 | [post] self | app.rb:44:53:46:5 | <captured entry> self |
52+
| app.rb:85:5:85:9 | [post] self | app.rb:56:32:58:5 | <captured entry> self |
53+
| app.rb:85:5:85:9 | [post] self | app.rb:60:48:62:5 | <captured entry> self |
54+
| app.rb:85:5:85:9 | [post] self | app.rb:74:11:77:5 | <captured entry> self |
55+
| app.rb:85:5:85:9 | [post] self | app.rb:79:11:82:5 | <captured entry> self |
56+
| app.rb:85:5:85:9 | [post] self | app.rb:89:16:92:5 | <captured entry> self |
57+
| app.rb:85:5:85:9 | [post] self | app.rb:94:15:96:5 | <captured entry> self |
58+
| app.rb:86:5:86:11 | [post] self | app.rb:2:22:4:5 | <captured entry> self |
59+
| app.rb:86:5:86:11 | [post] self | app.rb:10:21:13:5 | <captured entry> self |
60+
| app.rb:86:5:86:11 | [post] self | app.rb:15:23:18:5 | <captured entry> self |
61+
| app.rb:86:5:86:11 | [post] self | app.rb:24:26:26:5 | <captured entry> self |
62+
| app.rb:86:5:86:11 | [post] self | app.rb:37:16:42:5 | <captured entry> self |
63+
| app.rb:86:5:86:11 | [post] self | app.rb:44:53:46:5 | <captured entry> self |
64+
| app.rb:86:5:86:11 | [post] self | app.rb:56:32:58:5 | <captured entry> self |
65+
| app.rb:86:5:86:11 | [post] self | app.rb:60:48:62:5 | <captured entry> self |
66+
| app.rb:86:5:86:11 | [post] self | app.rb:74:11:77:5 | <captured entry> self |
67+
| app.rb:86:5:86:11 | [post] self | app.rb:79:11:82:5 | <captured entry> self |
68+
| app.rb:86:5:86:11 | [post] self | app.rb:89:16:92:5 | <captured entry> self |
69+
| app.rb:86:5:86:11 | [post] self | app.rb:94:15:96:5 | <captured entry> self |
70+
| app.rb:103:5:103:9 | [post] self | app.rb:2:22:4:5 | <captured entry> self |
71+
| app.rb:103:5:103:9 | [post] self | app.rb:10:21:13:5 | <captured entry> self |
72+
| app.rb:103:5:103:9 | [post] self | app.rb:15:23:18:5 | <captured entry> self |
73+
| app.rb:103:5:103:9 | [post] self | app.rb:24:26:26:5 | <captured entry> self |
74+
| app.rb:103:5:103:9 | [post] self | app.rb:37:16:42:5 | <captured entry> self |
75+
| app.rb:103:5:103:9 | [post] self | app.rb:44:53:46:5 | <captured entry> self |
76+
| app.rb:103:5:103:9 | [post] self | app.rb:56:32:58:5 | <captured entry> self |
77+
| app.rb:103:5:103:9 | [post] self | app.rb:60:48:62:5 | <captured entry> self |
78+
| app.rb:103:5:103:9 | [post] self | app.rb:74:11:77:5 | <captured entry> self |
79+
| app.rb:103:5:103:9 | [post] self | app.rb:79:11:82:5 | <captured entry> self |
80+
| app.rb:103:5:103:9 | [post] self | app.rb:89:16:92:5 | <captured entry> self |
81+
| app.rb:103:5:103:9 | [post] self | app.rb:94:15:96:5 | <captured entry> self |
82+
| app.rb:103:13:103:22 | [post] self | app.rb:2:22:4:5 | <captured entry> self |
83+
| app.rb:103:13:103:22 | [post] self | app.rb:10:21:13:5 | <captured entry> self |
84+
| app.rb:103:13:103:22 | [post] self | app.rb:15:23:18:5 | <captured entry> self |
85+
| app.rb:103:13:103:22 | [post] self | app.rb:24:26:26:5 | <captured entry> self |
86+
| app.rb:103:13:103:22 | [post] self | app.rb:37:16:42:5 | <captured entry> self |
87+
| app.rb:103:13:103:22 | [post] self | app.rb:44:53:46:5 | <captured entry> self |
88+
| app.rb:103:13:103:22 | [post] self | app.rb:56:32:58:5 | <captured entry> self |
89+
| app.rb:103:13:103:22 | [post] self | app.rb:60:48:62:5 | <captured entry> self |
90+
| app.rb:103:13:103:22 | [post] self | app.rb:74:11:77:5 | <captured entry> self |
91+
| app.rb:103:13:103:22 | [post] self | app.rb:79:11:82:5 | <captured entry> self |
92+
| app.rb:103:13:103:22 | [post] self | app.rb:89:16:92:5 | <captured entry> self |
93+
| app.rb:103:13:103:22 | [post] self | app.rb:94:15:96:5 | <captured entry> self |

0 commit comments

Comments
 (0)