Skip to content

Commit

Permalink
Merge pull request #15393 from erik-krogh/deps-jan-2024
Browse files Browse the repository at this point in the history
All: delete outdated deprecations
  • Loading branch information
erik-krogh authored Jan 23, 2024
2 parents 43453fe + 865df92 commit f1d6f56
Show file tree
Hide file tree
Showing 128 changed files with 56 additions and 1,979 deletions.
4 changes: 0 additions & 4 deletions config/identical-files.json
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,6 @@
"ruby/ql/lib/codeql/ruby/frameworks/data/internal/ApiGraphModelsExtensions.qll",
"python/ql/lib/semmle/python/frameworks/data/internal/ApiGraphModelsExtensions.qll"
],
"Typo database": [
"javascript/ql/src/Expressions/TypoDatabase.qll",
"ql/ql/src/codeql_ql/style/TypoDatabase.qll"
],
"Swift declarations test file": [
"swift/ql/test/extractor-tests/declarations/declarations.swift",
"swift/ql/test/library-tests/ast/declarations.swift"
Expand Down
5 changes: 5 additions & 0 deletions cpp/ql/lib/change-notes/2024-01-22-outdated-deprecations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
category: minorAnalysis
---
* Deleted many deprecated predicates and classes with uppercase `XML`, `SSA`, `SAL`, `SQL`, etc. in their names. Use the PascalCased versions instead.
* Deleted the deprecated `StrcatFunction` class, use `semmle.code.cpp.models.implementations.Strcat.qll` instead.
3 changes: 0 additions & 3 deletions cpp/ql/lib/semmle/code/cpp/Class.qll
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,6 @@ class Class extends UserType {
*/
predicate isPod() { is_pod_class(underlyingElement(this)) }

/** DEPRECATED: Alias for isPod */
deprecated predicate isPOD() { this.isPod() }

/**
* Holds if this class, struct or union is a standard-layout class
* [N4140 9(7)]. Also holds for structs in C programs.
Expand Down
6 changes: 0 additions & 6 deletions cpp/ql/lib/semmle/code/cpp/PODType03.qll
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ predicate isPodClass03(Class c) {
)
}

/** DEPRECATED: Alias for isPodClass03 */
deprecated predicate isPODClass03 = isPodClass03/1;

/**
* Holds if `t` is a POD type, according to the rules specified in
* C++03 3.9(10):
Expand All @@ -126,6 +123,3 @@ predicate isPodType03(Type t) {
isPodType03(ut.(SpecifiedType).getUnspecifiedType())
)
}

/** DEPRECATED: Alias for isPodType03 */
deprecated predicate isPODType03 = isPodType03/1;
33 changes: 0 additions & 33 deletions cpp/ql/lib/semmle/code/cpp/XML.qll
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ class XmlLocatable extends @xmllocatable, TXmlLocatable {
string toString() { none() } // overridden in subclasses
}

/** DEPRECATED: Alias for XmlLocatable */
deprecated class XMLLocatable = XmlLocatable;

/**
* An `XmlParent` is either an `XmlElement` or an `XmlFile`,
* both of which can contain other elements.
Expand Down Expand Up @@ -95,9 +92,6 @@ class XmlParent extends @xmlparent {
string toString() { result = this.getName() }
}

/** DEPRECATED: Alias for XmlParent */
deprecated class XMLParent = XmlParent;

/** An XML file. */
class XmlFile extends XmlParent, File {
XmlFile() { xmlEncoding(this, _) }
Expand All @@ -119,14 +113,8 @@ class XmlFile extends XmlParent, File {

/** Gets a DTD associated with this XML file. */
XmlDtd getADtd() { xmlDTDs(result, _, _, _, this) }

/** DEPRECATED: Alias for getADtd */
deprecated XmlDtd getADTD() { result = this.getADtd() }
}

/** DEPRECATED: Alias for XmlFile */
deprecated class XMLFile = XmlFile;

/**
* An XML document type definition (DTD).
*
Expand Down Expand Up @@ -163,9 +151,6 @@ class XmlDtd extends XmlLocatable, @xmldtd {
}
}

/** DEPRECATED: Alias for XmlDtd */
deprecated class XMLDTD = XmlDtd;

/**
* An XML element in an XML file.
*
Expand Down Expand Up @@ -221,9 +206,6 @@ class XmlElement extends @xmlelement, XmlParent, XmlLocatable {
override string toString() { result = this.getName() }
}

/** DEPRECATED: Alias for XmlElement */
deprecated class XMLElement = XmlElement;

/**
* An attribute that occurs inside an XML element.
*
Expand Down Expand Up @@ -254,9 +236,6 @@ class XmlAttribute extends @xmlattribute, XmlLocatable {
override string toString() { result = this.getName() + "=" + this.getValue() }
}

/** DEPRECATED: Alias for XmlAttribute */
deprecated class XMLAttribute = XmlAttribute;

/**
* A namespace used in an XML file.
*
Expand All @@ -273,9 +252,6 @@ class XmlNamespace extends XmlLocatable, @xmlnamespace {
/** Gets the URI of this namespace. */
string getUri() { xmlNs(this, _, result, _) }

/** DEPRECATED: Alias for getUri */
deprecated string getURI() { result = this.getUri() }

/** Holds if this namespace has no prefix. */
predicate isDefault() { this.getPrefix() = "" }

Expand All @@ -286,9 +262,6 @@ class XmlNamespace extends XmlLocatable, @xmlnamespace {
}
}

/** DEPRECATED: Alias for XmlNamespace */
deprecated class XMLNamespace = XmlNamespace;

/**
* A comment in an XML file.
*
Expand All @@ -309,9 +282,6 @@ class XmlComment extends @xmlcomment, XmlLocatable {
override string toString() { result = this.getText() }
}

/** DEPRECATED: Alias for XmlComment */
deprecated class XMLComment = XmlComment;

/**
* A sequence of characters that occurs between opening and
* closing tags of an XML element, excluding other elements.
Expand All @@ -335,6 +305,3 @@ class XmlCharacters extends @xmlcharacters, XmlLocatable {
/** Gets a printable representation of this XML character sequence. */
override string toString() { result = this.getCharacters() }
}

/** DEPRECATED: Alias for XmlCharacters */
deprecated class XMLCharacters = XmlCharacters;
3 changes: 0 additions & 3 deletions cpp/ql/lib/semmle/code/cpp/commons/NULL.qll
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ class NullMacro extends Macro {
NullMacro() { this.getHead() = "NULL" }
}

/** DEPRECATED: Alias for NullMacro */
deprecated class NULLMacro = NullMacro;

/** A use of the NULL macro. */
class NULL extends Literal {
NULL() { exists(NullMacro nm | this = nm.getAnInvocation().getAnExpandedElement()) }
Expand Down
22 changes: 0 additions & 22 deletions cpp/ql/lib/semmle/code/cpp/commons/Strcat.qll

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,3 @@ module Ssa {

predicate hasUnreachedInstruction = Cached::hasUnreachedInstructionCached/1;
}

/** DEPRECATED: Alias for Ssa */
deprecated module SSA = Ssa;
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ import semmle.code.cpp.ir.implementation.unaliased_ssa.internal.reachability.Rea
import semmle.code.cpp.ir.implementation.unaliased_ssa.internal.reachability.Dominance as Dominance
import semmle.code.cpp.ir.implementation.aliased_ssa.IR as NewIR
import semmle.code.cpp.ir.implementation.internal.TInstruction::AliasedSsaInstructions as SsaInstructions

/** DEPRECATED: Alias for SsaInstructions */
deprecated module SSAInstructions = SsaInstructions;

import semmle.code.cpp.ir.internal.IRCppLanguage as Language
import AliasedSSA as Alias
import semmle.code.cpp.ir.implementation.internal.TOperand::AliasedSsaOperands as SsaOperands

/** DEPRECATED: Alias for SsaOperands */
deprecated module SSAOperands = SsaOperands;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@ import semmle.code.cpp.ir.internal.IRCppLanguage as Language
import semmle.code.cpp.ir.implementation.raw.internal.IRConstruction as IRConstruction
import semmle.code.cpp.ir.implementation.unaliased_ssa.internal.SSAConstruction as UnaliasedSsa
import semmle.code.cpp.ir.implementation.aliased_ssa.internal.SSAConstruction as AliasedSsa

/** DEPRECATED: Alias for AliasedSsa */
deprecated module AliasedSSA = AliasedSsa;
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,3 @@ module Ssa {

predicate hasUnreachedInstruction = Cached::hasUnreachedInstructionCached/1;
}

/** DEPRECATED: Alias for Ssa */
deprecated module SSA = Ssa;
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ import semmle.code.cpp.ir.implementation.raw.internal.reachability.Dominance as
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR as NewIR
import semmle.code.cpp.ir.implementation.raw.internal.IRConstruction as RawStage
import semmle.code.cpp.ir.implementation.internal.TInstruction::UnaliasedSsaInstructions as SsaInstructions

/** DEPRECATED: Alias for SsaInstructions */
deprecated module SSAInstructions = SsaInstructions;

import semmle.code.cpp.ir.internal.IRCppLanguage as Language
import SimpleSSA as Alias
import semmle.code.cpp.ir.implementation.internal.TOperand::UnaliasedSsaOperands as SsaOperands

/** DEPRECATED: Alias for SsaOperands */
deprecated module SSAOperands = SsaOperands;
21 changes: 0 additions & 21 deletions cpp/ql/src/Microsoft/SAL.qll
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ class SalMacro extends Macro {
}
}

/** DEPRECATED: Alias for SalMacro */
deprecated class SALMacro = SalMacro;

pragma[noinline]
private predicate isTopLevelMacroAccess(MacroAccess ma) { not exists(ma.getParentInvocation()) }

Expand All @@ -50,9 +47,6 @@ class SalAnnotation extends MacroInvocation {
}
}

/** DEPRECATED: Alias for SalAnnotation */
deprecated class SALAnnotation = SalAnnotation;

/**
* A SAL macro indicating that the return value of a function should always be
* checked.
Expand All @@ -63,9 +57,6 @@ class SalCheckReturn extends SalAnnotation {
}
}

/** DEPRECATED: Alias for SalCheckReturn */
deprecated class SALCheckReturn = SalCheckReturn;

/**
* A SAL macro indicating that a pointer variable or return value should not be
* `NULL`.
Expand All @@ -89,9 +80,6 @@ class SalNotNull extends SalAnnotation {
}
}

/** DEPRECATED: Alias for SalNotNull */
deprecated class SALNotNull = SalNotNull;

/**
* A SAL macro indicating that a value may be `NULL`.
*/
Expand All @@ -105,9 +93,6 @@ class SalMaybeNull extends SalAnnotation {
}
}

/** DEPRECATED: Alias for SalMaybeNull */
deprecated class SALMaybeNull = SalMaybeNull;

/**
* A parameter annotated by one or more SAL annotations.
*/
Expand All @@ -124,9 +109,6 @@ class SalParameter extends Parameter {
predicate isInOut() { a.getMacroName().toLowerCase().matches("%\\_inout%") }
}

/** DEPRECATED: Alias for SalParameter */
deprecated class SALParameter = SalParameter;

///////////////////////////////////////////////////////////////////////////////
// Implementation details
/**
Expand Down Expand Up @@ -199,9 +181,6 @@ class SalElement extends Element {
}
}

/** DEPRECATED: Alias for SalElement */
deprecated class SALElement = SalElement;

/** Holds if `file` contains a SAL annotation. */
pragma[noinline]
private predicate containsSalAnnotation(File file) { any(SalAnnotation a).getFile() = file }
Expand Down
6 changes: 0 additions & 6 deletions cpp/ql/src/Security/CWE/CWE-497/SystemData.qll
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ class SqlClientInfo extends SystemData {
override predicate isSensitive() { any() }
}

/** DEPRECATED: Alias for SqlClientInfo */
deprecated class SQLClientInfo = SqlClientInfo;

private predicate sqlConnectInfo(FunctionCall source, Expr use) {
(
source.getTarget().hasName("mysql_connect") or
Expand All @@ -77,9 +74,6 @@ class SqlConnectInfo extends SystemData {
override predicate isSensitive() { any() }
}

/** DEPRECATED: Alias for SqlConnectInfo */
deprecated class SQLConnectInfo = SqlConnectInfo;

private predicate posixSystemInfo(FunctionCall source, DataFlow::Node use) {
// size_t confstr(int name, char *buf, size_t len)
// - various OS / system strings, such as the libc version
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
category: minorAnalysis
---
* Deleted many deprecated predicates and classes with uppercase `SSL`, `XML`, `URI`, `SSA` etc. in their names. Use the PascalCased versions instead.
* Deleted the deprecated `getALocalFlowSucc` predicate and `TaintType` class from the dataflow library.
* Deleted the deprecated `Newobj` and `Rethrow` classes, use `NewObj` and `ReThrow` instead.
* Deleted the deprecated `getAFirstRead`, `hasAdjacentReads`, `lastRefBeforeRedef`, and `hasLastInputRef` predicates from the SSA library.
* Deleted the deprecated `getAReachableRead` predicate from the `AssignableRead` and `VariableRead` classes.
* Deleted the deprecated `hasQualifiedName` predicate from the `NamedElement` class.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ predicate maybeUsedInFnvFunction(Variable v, Operation xor, Operation mul, LoopS
loop.getAChild*() = xor.getEnclosingStmt()
}

/** DEPRECATED: Alias for maybeUsedInFnvFunction */
deprecated predicate maybeUsedInFNVFunction = maybeUsedInFnvFunction/4;

/**
* Holds if the arguments are used in a way that resembles an Elf-Hash hash function
* where there is a loop statement `loop` where the variable `v` is used in an xor `xor` expression
Expand Down
12 changes: 0 additions & 12 deletions csharp/ql/lib/semmle/code/asp/WebConfig.qll
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,10 @@ class FormsElement extends XmlElement {
result = this.getAttribute("requireSSL").getValue().trim().toLowerCase()
}

/** DEPRECATED: Alias for getRequireSsl */
deprecated string getRequireSSL() { result = this.getRequireSsl() }

/**
* Holds if `requireSSL` value is true.
*/
predicate isRequireSsl() { this.getRequireSsl() = "true" }

/** DEPRECATED: Alias for isRequireSsl */
deprecated predicate isRequireSSL() { this.isRequireSsl() }
}

/** A `<httpCookies>` tag in an ASP.NET configuration file. */
Expand All @@ -124,9 +118,6 @@ class HttpCookiesElement extends XmlElement {
result = this.getAttribute("requireSSL").getValue().trim().toLowerCase()
}

/** DEPRECATED: Alias for getRequireSsl */
deprecated string getRequireSSL() { result = this.getRequireSsl() }

/**
* Holds if there is any chance that `requireSSL` is set to `true` either globally or for Forms.
*/
Expand All @@ -136,9 +127,6 @@ class HttpCookiesElement extends XmlElement {
not this.getRequireSsl() = "false" and // not set all, i.e. default
exists(FormsElement forms | forms.getFile() = this.getFile() | forms.isRequireSsl())
}

/** DEPRECATED: Alias for isRequireSsl */
deprecated predicate isRequireSSL() { this.isRequireSsl() }
}

/** A `Transform` attribute in a Web.config transformation file. */
Expand Down
Loading

0 comments on commit f1d6f56

Please sign in to comment.