Skip to main content
2024.3
AskMe (beta)
Loading icon

%SYSTEM.CodeScanner

class %SYSTEM.CodeScanner extends %SYSTEM.Help

Used to scan user code looking for references to deprecated functionality.

Method Inventory

Parameters

parameter DOMAIN = %Utility;

Methods

deprecated classmethod Scan(SearchList As %String = "*.*")
This method is deprecated. Use the ScanDocuments class Query instead.

Scan this namespace looking for code that may not work correctly due to use of unsupported features. You can pass an options SearchList argument which is a mask of which documents to search for.

deprecated classmethod ScanAll(SearchList As %String = "*.*")
This method is deprecated. Use the ScanDocuments class Query instead.

Scan all namespaces on this system looking for code that may not work correctly due to use of unsupported features. You can pass an options SearchList argument which is a mask of which documents to search for.

Queries

query ScanDocuments(mapped As %Boolean = 0)
Selects Document As %String(MAXLEN=512), Location As %String, Message As %String
Scan user-defined classes and routines in this namespace for references to classes and system functions that have been deprecated or should be replaced.

ObjectScript code in the routine body, Property SqlComputeCode, and Method and Trigger implementations with Language = objectscript is scanned. Classes defined with the Deprecated keyword will not be scanned. The mapped argument controls whether documents mapped from a non-default database are scanned. By default, only documents in the default database will be scanned.

The query returns:

  • Document - The name of the document, including the file extension.
  • Location - A line number or class keyword describing where the deprecated reference is located in Document.
  • Message - A string describing the deprecated reference at Location in Document.
A row will be returned if the following code structures are encountered:
  • A class defined with the Deprecated keyword that is:
    • Referenced in ObjectScript code using ##class() or $SYSTEM.class.method() syntax.
    • In the superclass, CompileAfter, DependsOn, or PropertyClass list of a class definition.
    • Defined as the type of an argument in a Method or class Query's argument list.
    • Defined as the return type of a Method.
    • Defined as the type of a Property or class Query.
  • A Method defined with the Deprecated keyword that is referenced using:
    • ##class().method() syntax.
    • $SYSTEM.class.method() syntax.
    • variable.method() syntax, where variable is a method argument defined with a type or a local variable with a type declared using #Dim.
    • $THIS.method() syntax, when in a class definition.
    • Relative dot (..method()) syntax, when in a class definition.
  • A Property defined with the Deprecated keyword that is referenced using:
    • variable.property syntax, where variable is a method argument defined with a type or a local variable with a type declared using #Dim.
    • $THIS.property syntax, when in a class definition.
    • Instance variable (i%property) syntax, when in a class definition.
  • A Parameter defined with the Deprecated keyword that is referenced using:
    • ##class().#parameter syntax.
    • variable.#parameter syntax, where variable is a method argument defined with a type or a local variable with a type declared using #Dim.
    • $THIS.#parameter syntax, when in a class definition.
    • Relative dot (..#parameter) syntax, when in a class definition.
  • A $ZUTIL function listed in the $ZUTIL Replacements documentationOpens in a new tab.
  • A $ZOBJ function that has been replaced with a standard system functionOpens in a new tab.
  • The #sqlcompile modeOpens in a new tab macro preprocessor directive.
  • $ZF(-1) or $ZF(-2).
  • Class keyword LegacyInstanceContext or a reference to the obsolete %this variable.
  • Property keyword SqlListDelimiter or SqlListType.
  • A Method or Trigger with keyword CodeMode set to 'generator'.
  • A system function that is not supported in user code.
  • A short class name that did not match a class in any of the imported packages.
  • A short class name that matched classes in multiple imported packages and therefore was ambiguous.
  • A Method or class Query argument list that is formatted incorrectly.

Inherited Members

Inherited Methods

FeedbackOpens in a new tab