Merge pull request #10108 from hvitved/remove-redundant-overrides

Remove redundant overrides
This commit is contained in:
Tom Hvitved 2022-08-19 16:43:23 +02:00 коммит произвёл GitHub
Родитель 75f62098e0 18fb4a87af
Коммит a0a3dfb93d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
19 изменённых файлов: 3 добавлений и 57 удалений

Просмотреть файл

@ -218,8 +218,6 @@ class Folder extends Container, @folder {
class File extends Container, @file {
override string getAbsolutePath() { files(underlyingElement(this), result) }
override string toString() { result = Container.super.toString() }
override string getAPrimaryQlClass() { result = "File" }
override Location getLocation() {

Просмотреть файл

@ -309,8 +309,6 @@ class FunctionPointerType extends Type, CustomModifierReceiver, Parameterizable,
/** Gets the calling convention. */
int getCallingConvention() { cil_function_pointer_calling_conventions(this, result) }
override string toString() { result = Type.super.toString() }
/** Holds if the return type is `void`. */
predicate returnsVoid() { this.getReturnType() instanceof VoidType }

Просмотреть файл

@ -215,11 +215,7 @@ class Callable extends DotNet::Callable, Parameterizable, ExprOrStmtParent, @cal
/** Gets a `Call` that has this callable as a target. */
Call getACall() { this = result.getTarget() }
override Parameter getParameter(int n) { result = Parameterizable.super.getParameter(n) }
override Parameter getAParameter() { result = Parameterizable.super.getAParameter() }
override int getNumberOfParameters() { result = Parameterizable.super.getNumberOfParameters() }
}
/**
@ -276,8 +272,6 @@ class Method extends Callable, Virtualizable, Attributable, @method {
predicate hasParams() { exists(this.getParamsType()) }
// Remove when `Callable.isOverridden()` is removed
override predicate isOverridden() { Virtualizable.super.isOverridden() }
override predicate fromSource() {
Callable.super.fromSource() and
not this.isCompilerGenerated()
@ -472,8 +466,6 @@ class RecordCloneMethod extends Method, DotNet::RecordCloneCallable {
override Constructor getConstructor() {
result = DotNet::RecordCloneCallable.super.getConstructor()
}
override string toString() { result = Method.super.toString() }
}
/**

Просмотреть файл

@ -116,10 +116,6 @@ class Namespace extends DotNet::Namespace, TypeContainer, Declaration, @namespac
override Location getALocation() { result = this.getADeclaration().getALocation() }
override string toString() { result = DotNet::Namespace.super.toString() }
override predicate hasQualifiedName(string a, string b) {
DotNet::Namespace.super.hasQualifiedName(a, b)
}
}
/**

Просмотреть файл

@ -42,8 +42,6 @@ class DeclarationWithAccessors extends AssignableMember, Virtualizable, Attribut
}
override Type getType() { none() }
override string toString() { result = AssignableMember.super.toString() }
}
/**

Просмотреть файл

@ -817,10 +817,6 @@ class TranslatedNonFieldVariableAccess extends TranslatedVariableAccess {
else result = this.getInstruction(AddressTag())
}
override Instruction getInstructionOperand(InstructionTag tag, OperandTag operandTag) {
result = TranslatedVariableAccess.super.getInstructionOperand(tag, operandTag)
}
override predicate hasInstruction(Opcode opcode, InstructionTag tag, CSharpType resultType) {
TranslatedVariableAccess.super.hasInstruction(opcode, tag, resultType)
or

Просмотреть файл

@ -21,10 +21,6 @@ abstract class TranslatedCompilerGeneratedDeclaration extends LocalVariableDecla
result = "compiler generated declaration (" + generatedBy.toString() + ")"
}
override TranslatedElement getChild(int id) {
result = LocalVariableDeclarationBase.super.getChild(id)
}
override Instruction getChildSuccessor(TranslatedElement child) {
child = getInitialization() and result = getInstruction(InitializerStoreTag())
}

Просмотреть файл

@ -234,8 +234,6 @@ class File extends Container, @file {
/** Gets a toplevel piece of JavaScript code in this file. */
TopLevel getATopLevel() { result.getFile() = this }
override string toString() { result = Container.super.toString() }
/** Gets the URL of this file. */
override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" }

Просмотреть файл

@ -43,8 +43,6 @@ abstract private class BracketedListOfExpressions extends Expr {
* An array expression viewed as a bracketed list of expressions.
*/
private class ArrayExprIsABracketedListOfExpressions extends ArrayExpr, BracketedListOfExpressions {
override predicate isImpure() { ArrayExpr.super.isImpure() }
/** Gets the `i`th element of this array literal. */
override Expr getElement(int i) { result = ArrayExpr.super.getElement(i) }
}

Просмотреть файл

@ -2,8 +2,6 @@ import semmle.javascript.frameworks.Testing
class MyTest extends Test, CallExpr {
MyTest() { getCallee().(VarAccess).getName() = "mytest" }
override string toString() { result = CallExpr.super.toString() }
}
from Test t

Просмотреть файл

@ -68,8 +68,6 @@ class ListComp extends ListComp_, Comp {
override Expr getIterable() { result = ListComp_.super.getIterable() }
override string toString() { result = ListComp_.super.toString() }
override Expr getElt() { result = Comp.super.getElt() }
}

Просмотреть файл

@ -2,8 +2,6 @@ import python
class KeyValuePair extends KeyValuePair_, DictDisplayItem {
/* syntax: Expr : Expr */
override Location getLocation() { result = KeyValuePair_.super.getLocation() }
override string toString() { result = KeyValuePair_.super.toString() }
/** Gets the value of this dictionary unpacking. */
@ -20,8 +18,6 @@ class KeyValuePair extends KeyValuePair_, DictDisplayItem {
/** A double-starred expression in a call or dict literal. */
class DictUnpacking extends DictUnpacking_, DictUnpackingOrKeyword, DictDisplayItem {
override Location getLocation() { result = DictUnpacking_.super.getLocation() }
override string toString() { result = DictUnpacking_.super.toString() }
/** Gets the value of this dictionary unpacking. */
@ -47,8 +43,6 @@ abstract class DictDisplayItem extends DictItem {
/** A keyword argument in a call. For example `arg=expr` in `foo(0, arg=expr)` */
class Keyword extends Keyword_, DictUnpackingOrKeyword {
/* syntax: name = Expr */
override Location getLocation() { result = Keyword_.super.getLocation() }
override string toString() { result = Keyword_.super.toString() }
/** Gets the value of this keyword argument. */

Просмотреть файл

@ -70,9 +70,7 @@ abstract class AttrWrite extends AttrRef {
* ```
* Also gives access to the `value` being written, by extending `DefinitionNode`.
*/
private class AttributeAssignmentNode extends DefinitionNode, AttrNode {
override ControlFlowNode getValue() { result = DefinitionNode.super.getValue() }
}
private class AttributeAssignmentNode extends DefinitionNode, AttrNode { }
/** A simple attribute assignment: `object.attr = value`. */
private class AttributeAssignmentAsAttrWrite extends AttrWrite, CfgNode {

Просмотреть файл

@ -819,8 +819,6 @@ class Declaration extends TDeclaration, AstNode {
or
result = any(Class c).getQLDocFor(this)
}
override AstNode getAChild(string pred) { result = super.getAChild(pred) }
}
/** An entity that can be declared in a module. */
@ -1126,8 +1124,6 @@ class NoneCall extends TNoneCall, Call, Formula {
NoneCall() { this = TNoneCall(call) }
override string getAPrimaryQlClass() { result = "NoneCall" }
override AstNode getParent() { result = Call.super.getParent() }
}
/**

Просмотреть файл

@ -11,7 +11,7 @@ class Foo extends AstNode {
}
class Sub extends Foo {
override predicate baz() { super.baz() }
override predicate baz() { not super.baz() }
}
query predicate test2() { any(Foo f).bar() }

Просмотреть файл

@ -6,7 +6,7 @@ getTarget
| Baz.qll:8:18:8:44 | MemberCall | Baz.qll:4:10:4:24 | ClassPredicate getImportedPath |
| Foo.qll:5:26:5:30 | PredicateCall | Foo.qll:3:11:3:13 | ClasslessPredicate foo |
| Foo.qll:10:21:10:25 | PredicateCall | Foo.qll:8:13:8:15 | ClassPredicate bar |
| Foo.qll:14:30:14:40 | MemberCall | Foo.qll:10:13:10:15 | ClassPredicate baz |
| Foo.qll:14:34:14:44 | MemberCall | Foo.qll:10:13:10:15 | ClassPredicate baz |
| Foo.qll:17:27:17:42 | MemberCall | Foo.qll:8:13:8:15 | ClassPredicate bar |
| Foo.qll:29:5:29:16 | PredicateCall | Foo.qll:20:13:20:20 | ClasslessPredicate myThing2 |
| Foo.qll:29:5:29:16 | PredicateCall | Foo.qll:26:13:26:18 | ClasslessPredicate alias2 |

Просмотреть файл

@ -214,8 +214,6 @@ class Namespace extends ModuleBase, ConstantWriteAccess, TNamespace {
result = ModuleBase.super.getAChild(pred) or
result = ConstantWriteAccess.super.getAChild(pred)
}
final override string toString() { result = ConstantWriteAccess.super.toString() }
}
/**

Просмотреть файл

@ -122,8 +122,6 @@ class VariableAccess extends Expr instanceof VariableAccessImpl {
or
synthChild(any(BlockParameter p), 0, this)
}
final override string toString() { result = VariableAccessImpl.super.toString() }
}
/** An access to a variable where the value is updated. */

Просмотреть файл

@ -1380,10 +1380,6 @@ module Trees {
final override predicate first(AstNode first) { this.firstInner(first) }
final override predicate last(AstNode last, Completion c) { this.lastInner(last, c) }
final override predicate succ(AstNode pred, AstNode succ, Completion c) {
BodyStmtTree.super.succ(pred, succ, c)
}
}
private class UndefStmtTree extends StandardPreOrderTree, UndefStmt {