mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Remove redundant overrides
This commit is contained in:
@@ -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() }
|
||||
}
|
||||
|
||||
|
||||
@@ -324,9 +324,7 @@ class ControlFlowNode extends @py_flow_node {
|
||||
* This avoids wasting time on the trivial overrides on the ControlFlowNode subclasses.
|
||||
*/
|
||||
|
||||
private class AnyNode extends ControlFlowNode {
|
||||
override AstNode getNode() { result = super.getNode() }
|
||||
}
|
||||
private class AnyNode extends ControlFlowNode { }
|
||||
|
||||
/**
|
||||
* Check whether a SSA variable has complete points-to information.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -794,8 +794,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. */
|
||||
@@ -1101,8 +1099,6 @@ class NoneCall extends TNoneCall, Call, Formula {
|
||||
NoneCall() { this = TNoneCall(call) }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "NoneCall" }
|
||||
|
||||
override AstNode getParent() { result = Call.super.getParent() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,9 +10,7 @@ class Foo extends AstNode {
|
||||
predicate baz() { bar() }
|
||||
}
|
||||
|
||||
class Sub extends Foo {
|
||||
override predicate baz() { super.baz() }
|
||||
}
|
||||
class Sub extends Foo { }
|
||||
|
||||
query predicate test2() { any(Foo f).bar() }
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user