%ZHSLIB.PackageManager.Developer.DependencyAnalyzer
class %ZHSLIB.PackageManager.Developer.DependencyAnalyzer
Method Inventory
- AccumulatePackageNamesInCurrentNamespace()
- ClassExtractionComplete()
- ExtractClassReferencesFromLine()
- ExtractClassReferencesFromMethod()
- ExtractClassReferencesFromQuery()
- ExtractClassReferencesToName()
- ExtractFileReferencesFromClass()
- ExtractFileReferencesFromIncludeFile()
- ExtractIncludeFileReferencesFromLine()
- ExtractIncludeReferencesToName()
- ExtractReferencesFromIncludeFileLine()
- GetClassNameFromTableName()
- RunForAllModules()
- RunForAllReferences()
- RunForInvalidReferences()
Parameters
parameter CLSSUFFIX = .CLS;
parameter INCPREFIX = !!!INC.;
Prefix to indentify .inc files
parameter INCSUFFIX = .INC;
Methods
classmethod AccumulatePackageNamesInCurrentNamespace()
Get names of all packages in the current namespace and store output in a temp
global.
classmethod ClassExtractionComplete(pSourceClass As %String, pTargetSubscript As %String, pProgressListener As %ZHSLIB.PackageManager.Developer.IProgressListener, pIgnoredStringRef As %String) as %Status
classmethod ExtractClassReferencesFromLine(pSourceClass As %String, pMethod As %String, pLine As %Integer, pLineTokenList As %List, ByRef pRefArray, ByRef pMethodCode, pIgnoredStringRef As %String)
Called by ExtractFileReferencesFromClass(), FromMethod() and FromQuery()
classmethod ExtractClassReferencesFromMethod(pSourceClass As %String, pMethod As %String, ByRef pMethodCode, ByRef pMethodMap, ByRef pRefArray, pIgnoredStringRef As %String) as %Status
Helper method called by ExtractFileReferencesFromClass().
Handles lines inside a method by calling ExtractClassReferencesFromLine()
classmethod ExtractClassReferencesFromQuery(pSourceClass As %String, pQuery As %String, ByRef pMethodCode, ByRef pMethodMap, ByRef pRefArray, pIgnoredStringRef As %String) as %Status
Helper method called by ExtractFileReferencesFromClass().
Handles lines inside a query by calling ExtractClassReferencesFromLine()
classmethod ExtractClassReferencesToName(pSourceClass As %String, pTargetSubscript As %String, pProgressListener As %ZHSLIB.PackageManager.Developer.IProgressListener, pIgnoredStringRef As %String) as %Status
Called directly by RunforAllReferences() / RunforInvalidReferences() on .cls files
classmethod ExtractFileReferencesFromClass(pSourceClass As %String, ByRef pRefArray, pIgnoredStringRef As %String) as %Status
This method extracts all referenced classes from a given .cls file
calls ExtractIncludeFileReferencesFromLine() to handle line with include file,
calls ExtractClassReferencesFromLine() to handle other lines
classmethod ExtractFileReferencesFromIncludeFile(pSourceIncludeFile As %String, ByRef pRefArray, pIgnoredStringRef As %String) as %Status
This method extracts all referenced classes from a give .inc file
classmethod ExtractIncludeFileReferencesFromLine(pSourceClass As %String, pMethod As %String, pLine As %Integer, pLineTokenList As %List, ByRef pRefArray, ByRef pMethodCode)
Extracts include file referenced in a class by an Include tag
We assume that this method will only be called with the line starts with "Include"
classmethod ExtractIncludeReferencesToName(pSourceClass As %String, pTargetSubscript As %String, pProgressListener As %ZHSLIB.PackageManager.Developer.IProgressListener, pIgnoredStringRef As %String) as %Status
Called directly by RunforAllReferences() / RunforInvalidReferences() on .inc files
classmethod ExtractReferencesFromIncludeFileLine(pSourceClass As %String, pMethod As %String, pLine As %Integer, pLineTokenList As %List, ByRef pRefArray, pLineCode As %String, pIgnoredStringRef As %String)
Called by ExtractFileReferencesFromIncludeFile, will only process lines in an include file
classmethod GetClassNameFromTableName(pSourceClass As %String, pFullTableName As %String, Output pClassName) as %Status
Helper method called by ExtractClassReferencesFromLine
classmethod RunForAllModules() as %Status
@API.Method
@Modifier Availability InterSystems
classmethod RunForAllReferences(pName As %String, Output pReferences, pVerbose As %Boolean = 1, pSave As %Boolean = 1, pProgressListener As %ZHSLIB.PackageManager.Developer.IProgressListener = $$$NULLOREF, Output pRunID As %String, pIgnoredStringRef As %String = "", pDirectDepsOnly As %Boolean = 0) as %Status
@API.Method
@Modifier Availability InterSystems
pName: Name of the item that you want to run the dependency analyzer on to find all its references.
pReferences: multi-dim array of references in the input item, including class/include files + module references
pVerbose: default to 1. If set to 1, references will be written to terminal / Studio output window
pProgressListener: Dependency analyzer socket for running deps
pRunID: ID of ModuleResults persistent class
pIgnoredStringRef: comma-separated string of string references that will be ignored. If set to $char(0), then will ignore all string references including classes.
pDirectDepsOnly: Include only direct dependencies rather than transitive ones as well.
classmethod RunForInvalidReferences(pName As %String, Output pInvalidReferences, pVerbose As %Boolean = 1, pSave As %Boolean = 1, pProgressListener As %ZHSLIB.PackageManager.Developer.IProgressListener = $$$NULLOREF, Output pRunID As %String, pIgnoredStringRef As %String = "", pDirectDepsOnly As %Boolean = 0) as %Status
@API.Method
@Modifier Availability InterSystems
pName: Name of the module / item that you want to run the dependency analyzer on, to find all invalid references. If no extension is specified, it will be recognized as a module
pInvalidReferences: multi-dim array of invalid references in the input module / item, including missing class/include files + missing module references
pVerbose: default to 1. If set to 1, invalid references will be written to terminal / Studio output window
pProgressListener: Dependency analyzer socket for running deps
pRunID: ID of ModuleResults persistent class
pIgnoredStringRef: comma-separated string of string references that will be ignored. If set to $char(0), then will ignore all string references including classes.
pDirectDepsOnly: Include only direct dependencies rather than transitive ones as well.
Queries
query LatestResults(pProblemModule As %String)
SQL Query:
select Run->TargetModule,ProblemItem,ReferencedModule,ReferencedItem,ProblemMember,ProblemLine,ProblemCode from %ZHSLIB_PackageManager_Developer_DependencyAnalyzer.Problem where :pProblemModule is null or :pProblemModule = Run->TargetModule having Run->ID = MAX(Run->ID %FOREACH (Run->TargetModule))
select Run->TargetModule,ProblemItem,ReferencedModule,ReferencedItem,ProblemMember,ProblemLine,ProblemCode from %ZHSLIB_PackageManager_Developer_DependencyAnalyzer.Problem where :pProblemModule is null or :pProblemModule = Run->TargetModule having Run->ID = MAX(Run->ID %FOREACH (Run->TargetModule))
@API.Query
@Modifier Availability InterSystems