Skip to content

Commit

Permalink
fix: UpdateComplexity and one of the calls in GetCurrentByName no lon…
Browse files Browse the repository at this point in the history
…ger use GetCurrentByName just for getting the hash and code of a CodeUnit
  • Loading branch information
isc-cge committed Aug 13, 2024
1 parent 41a313b commit f8fd42e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cls/TestCoverage/Data/CodeUnit.cls
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ ClassMethod GetCurrentByName(pInternalName As %String, pSourceNamespace As %Stri
$$$ThrowOnError(tSC)
Set tKnownHash = tMapToResult.%GetData(1)
Set tMapToUnit = ..HashOpen(tKnownHash,,.tSC)
$$$ThrowOnError(tSC)
$$$ThrowOnError(..GetCurrentByName(tMapToUnit.Name_"."_tMapToUnit.Type,pSourceNamespace,.tUpdatedUnit,.pCache))
If (tUpdatedUnit.Hash '= tKnownHash) {
$$$ThrowOnError(tSC)
do ..GetCurrentHash(tMapToUnit.Name, tMapToUnit.Type, .tUpdatedHash, , )
If (tUpdatedHash '= tKnownHash) {
//Clear out old data and flag the need for an update.
Set tNeedsUpdate = 1
&sql(delete from TestCoverage_Data.CodeUnitMap where ToHash = :tKnownHash)
Expand Down Expand Up @@ -247,7 +247,6 @@ ClassMethod GetCurrentByName(pInternalName As %String, pSourceNamespace As %Stri
/// Fill in the LineIsPython property of .cls files
Method UpdatePythonLines(pName As %String, ByRef pPyCodeUnit) As %Status
{

Set tSC = $$$OK
Set tOriginalNamespace = $Namespace
Set tInitTLevel = $TLevel
Expand Down Expand Up @@ -543,8 +542,9 @@ Method UpdateComplexity() As %Status

// python methods
If (##class(TestCoverage.Manager).HasPython(..Name)) {
do ##class(TestCoverage.Data.CodeUnit).GetCurrentByName(..Name _ ".PY", , .pPyCodeUnit, ) // need the source code for the python
set tDocumentText = pPyCodeUnit.Lines.Serialize()
do ..GetCurrentHash(..Name, "PY", ,.tPyCodeArray, ) // need the source code for the python to pass into the method complexity calculator
do ##class(TestCoverage.Utils).CodeArrayToList(.tPyCodeArray, .tDocumentText)
set tDocumentText = tDocumentText _ $listbuild("")
set tMethodComplexities = ..GetPythonComplexities(tDocumentText)
}

Expand Down

0 comments on commit f8fd42e

Please sign in to comment.