Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions go/ql/lib/change-notes/2026-11-18-outdated-deprecations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
category: breaking
---
* Removed deprecated aliases and predicates from the scope, type, control-flow, data-flow, framework, and security libraries.
* Removed deprecated `hasLocationInfo` predicates. Use `getLocation()` instead.
2 changes: 0 additions & 2 deletions go/ql/lib/go.qll
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import semmle.go.frameworks.BeegoOrm
import semmle.go.frameworks.Bun
import semmle.go.frameworks.CryptoLibraries
import semmle.go.frameworks.RsCors
import semmle.go.frameworks.Couchbase
import semmle.go.frameworks.Echo
import semmle.go.frameworks.ElazarlGoproxy
import semmle.go.frameworks.Email
Expand All @@ -56,7 +55,6 @@ import semmle.go.frameworks.K8sIoApiCoreV1
import semmle.go.frameworks.K8sIoClientGo
import semmle.go.frameworks.Logrus
import semmle.go.frameworks.Macaron
import semmle.go.frameworks.Mux
import semmle.go.frameworks.NoSQL
import semmle.go.frameworks.Protobuf
import semmle.go.frameworks.Revel
Expand Down
42 changes: 0 additions & 42 deletions go/ql/lib/semmle/go/Scopes.qll
Original file line number Diff line number Diff line change
Expand Up @@ -152,29 +152,6 @@ class Entity extends @object {
or
result = any(CaseClause cc | this = cc.getImplicitlyDeclaredVariable()).getLocation()
}

/**
* DEPRECATED: Use `getLocation()` instead.
*
* Holds if this element is at the specified location.
* The location spans column `startcolumn` of line `startline` to
* column `endcolumn` of line `endline` in file `filepath`.
* For more information, see
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
deprecated predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
or
// otherwise fall back on dummy location
not exists(this.getLocation()) and
filepath = "" and
startline = 0 and
startcolumn = 0 and
endline = 0 and
endcolumn = 0
}
}

/** A declared entity (that is, type, constant, variable or function). */
Expand Down Expand Up @@ -209,15 +186,9 @@ class DeclaredTypeEntity extends TypeEntity, DeclaredEntity, TypeParamParentEnti
TypeSpec getSpec() { result.getNameExpr() = this.getDeclaration() }
}

/** DEPRECATED: Use `DeclaredTypeEntity` instead. */
deprecated class DeclaredType = DeclaredTypeEntity;

/** A built-in type. */
class BuiltinTypeEntity extends TypeEntity, BuiltinEntity, @builtintypeobject { }

/** DEPRECATED: Use `BuiltinTypeEntity` instead. */
deprecated class BuiltinType = BuiltinTypeEntity;

/** A built-in or declared constant, variable, field, method or function. */
class ValueEntity extends Entity, @valueobject {
/** Gets a data-flow node that reads the value of this entity. */
Expand Down Expand Up @@ -702,19 +673,6 @@ class Callable extends TCallable {
Location getLocation() {
result = this.asFunction().getLocation() or result = this.asFuncLit().getLocation()
}

/**
* DEPRECATED: Use `getLocation()` instead.
*
* Holds if this element is at the specified location.
* The location spans column `sc` of line `sl` to
* column `ec` of line `el` in file `fp`.
* For more information, see
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
deprecated predicate hasLocationInfo(string fp, int sl, int sc, int el, int ec) {
this.getLocation().hasLocationInfo(fp, sl, sc, el, ec)
}
}

/** A statement label. */
Expand Down
23 changes: 0 additions & 23 deletions go/ql/lib/semmle/go/StringOps.qll
Original file line number Diff line number Diff line change
Expand Up @@ -558,29 +558,6 @@ module StringOps {

/** Gets the location of this element. */
Location getLocation() { result = this.asNode().getLocation() }

/**
* DEPRECATED: Use `getLocation()` instead.
*
* Holds if this element is at the specified location.
* The location spans column `startcolumn` of line `startline` to
* column `endcolumn` of line `endline` in file `filepath`.
* For more information, see
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
deprecated predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
or
// use dummy location for elements that don't have a corresponding node
not exists(this.getLocation()) and
filepath = "" and
startline = 0 and
startcolumn = 0 and
endline = 0 and
endcolumn = 0
}
}

/**
Expand Down
25 changes: 0 additions & 25 deletions go/ql/lib/semmle/go/Types.qll
Original file line number Diff line number Diff line change
Expand Up @@ -148,28 +148,6 @@ class Type extends @type {

/** Gets the location of this type. */
Location getLocation() { result = this.getEntity().getLocation() }

/**
* DEPRECATED: Use `getLocation()` instead.
*
* Holds if this element is at the specified location.
* The location spans column `startcolumn` of line `startline` to
* column `endcolumn` of line `endline` in file `filepath`.
* For more information, see
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
deprecated predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
or
not exists(this.getLocation()) and
filepath = "" and
startline = 0 and
startcolumn = 0 and
endline = 0 and
endcolumn = 0
}
}

/** An invalid type. */
Expand Down Expand Up @@ -1044,9 +1022,6 @@ class SendRecvChanType extends @sendrcvchantype, ChanType {
override string toString() { result = "send-receive-channel type" }
}

/** DEPRECATED: Use `DefinedType` instead. */
deprecated class NamedType = DefinedType;

/** A defined type. */
class DefinedType extends @definedtype, CompositeType {
/**
Expand Down
15 changes: 0 additions & 15 deletions go/ql/lib/semmle/go/VariableWithFields.qll
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,4 @@ class VariableWithFields extends TVariableWithFields {

/** Gets the location of this variable with fields. */
Location getLocation() { result = this.getBaseVariable().getLocation() }

/**
* DEPRECATED: Use `getLocation()` instead.
*
* Holds if this element is at the specified location.
* The location spans column `startcolumn` of line `startline` to
* column `endcolumn` of line `endline` in file `filepath`.
* For more information, see
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
deprecated predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
}
}
22 changes: 0 additions & 22 deletions go/ql/lib/semmle/go/controlflow/ControlFlowGraph.qll
Original file line number Diff line number Diff line change
Expand Up @@ -80,28 +80,6 @@ module ControlFlow {

/** Gets the file to which this node belongs. */
File getFile() { result = this.getLocation().getFile() }

/**
* DEPRECATED: Use `getLocation()` instead.
*
* Holds if this element is at the specified location.
* The location spans column `startcolumn` of line `startline` to
* column `endcolumn` of line `endline` in file `filepath`.
* For more information, see
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
deprecated predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
or
not exists(this.getLocation()) and
filepath = "" and
startline = 0 and
startcolumn = 0 and
endline = 0 and
endcolumn = 0
}
}

/** A synthetic entry node for a function or a file. */
Expand Down
18 changes: 0 additions & 18 deletions go/ql/lib/semmle/go/controlflow/IR.qll
Original file line number Diff line number Diff line change
Expand Up @@ -1156,24 +1156,6 @@ module IR {

/** Gets the source location for this element. */
Location getLocation() { none() }

/**
* DEPRECATED: Use `getLocation()` instead.
*
* Holds if this element is at the specified location.
*/
deprecated predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
or
not exists(this.getLocation()) and
filepath = "" and
startline = 0 and
startcolumn = 0 and
endline = 0 and
endcolumn = 0
}
}

/** An implicitly declared variable used as the target of a type-switch case write. */
Expand Down
10 changes: 0 additions & 10 deletions go/ql/lib/semmle/go/dataflow/FlowSummary.qll
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,9 @@ private import internal.DataFlowUtil
// import all instances below
private module Summaries { }

deprecated class SummaryComponent = Impl::Private::SummaryComponent;

deprecated module SummaryComponent = Impl::Private::SummaryComponent;

deprecated class SummaryComponentStack = Impl::Private::SummaryComponentStack;

deprecated module SummaryComponentStack = Impl::Private::SummaryComponentStack;

/** Provides the `Range` class used to define the extent of `SummarizedCallable`. */
module SummarizedCallable {
class Range = Impl::Public::SummarizedCallable;
}

class SummarizedCallable = Impl::Public::RelevantSummarizedCallable;

deprecated class RequiredSummaryComponentStack = Impl::Private::RequiredSummaryComponentStack;
15 changes: 0 additions & 15 deletions go/ql/lib/semmle/go/dataflow/GlobalValueNumbering.qll
Original file line number Diff line number Diff line change
Expand Up @@ -352,21 +352,6 @@ class GVN extends GvnBase {

/** Gets the location of this element. */
Location getLocation() { result = this.exampleNode().getLocation() }

/**
* DEPRECATED: Use `getLocation()` instead.
*
* Holds if this element is at the specified location.
* The location spans column `startcolumn` of line `startline` to
* column `endcolumn` of line `endline` in file `filepath`.
* For more information, see
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
deprecated predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
}
}

private predicate mkNumericConst(DataFlow::Node nd, string val) {
Expand Down
26 changes: 0 additions & 26 deletions go/ql/lib/semmle/go/dataflow/SSA.qll
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,6 @@ deprecated class SsaVariable extends SsaDefinition {
or
this instanceof SsaPhiDefinition and result = "phi"
}

/**
* DEPRECATED: Use `getLocation()` instead.
*
* Holds if this element is at the specified location.
*/
deprecated predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
}
}

/**
Expand Down Expand Up @@ -279,21 +268,6 @@ class SsaWithFields extends TSsaWithFields {

/** Gets the location of this SSA variable with fields. */
Location getLocation() { result = this.getBaseDefinition().getLocation() }

/**
* DEPRECATED: Use `getLocation()` instead.
*
* Holds if this element is at the specified location.
* The location spans column `startcolumn` of line `startline` to
* column `endcolumn` of line `endline` in file `filepath`.
* For more information, see
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
deprecated predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
}
}

/**
Expand Down
15 changes: 0 additions & 15 deletions go/ql/lib/semmle/go/dataflow/internal/DataFlowNodes.qll
Original file line number Diff line number Diff line change
Expand Up @@ -149,21 +149,6 @@ module Public {
/** Gets the location of this node. */
Location getLocation() { none() }

/**
* DEPRECATED: Use `getLocation()` instead.
*
* Holds if this element is at the specified location.
* The location spans column `startcolumn` of line `startline` to
* column `endcolumn` of line `endline` in file `filepath`.
* For more information, see
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
deprecated predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
}

/** Gets the file in which this node appears. */
File getFile() { result = this.getLocation().getFile() }

Expand Down
15 changes: 0 additions & 15 deletions go/ql/lib/semmle/go/dataflow/internal/DataFlowPrivate.qll
Original file line number Diff line number Diff line change
Expand Up @@ -331,21 +331,6 @@ class DataFlowCallable extends TDataFlowCallable {
result = this.asFileScope().getLocation() or
result = this.asSummarizedCallable().getLocation()
}

/**
* DEPRECATED: Use `getLocation()` instead.
*
* Holds if this callable is at the specified location.
* The location spans column `startcolumn` of line `startline` to
* column `endcolumn` of line `endline` in file `filepath`.
* For more information, see
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
deprecated predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
}
}

/** A function call relevant for data flow. */
Expand Down
Loading
Loading