Skip to content

Commit ba0aaf0

Browse files
committed
fix: UpdateComplexity and one of the calls in GetCurrentByName no longer use GetCurrentByName just for getting the hash and code of a CodeUnit
1 parent e8afd4e commit ba0aaf0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cls/TestCoverage/Data/CodeUnit.cls

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ ClassMethod GetCurrentByName(pInternalName As %String, pSourceNamespace As %Stri
8282
$$$ThrowOnError(tSC)
8383
Set tKnownHash = tMapToResult.%GetData(1)
8484
Set tMapToUnit = ..HashOpen(tKnownHash,,.tSC)
85-
$$$ThrowOnError(tSC)
86-
$$$ThrowOnError(..GetCurrentByName(tMapToUnit.Name_"."_tMapToUnit.Type,pSourceNamespace,.tUpdatedUnit,.pCache))
87-
If (tUpdatedUnit.Hash '= tKnownHash) {
85+
$$$ThrowOnError(tSC)
86+
do ..GetCurrentHash(tMapToUnit.Name, tMapToUnit.Type, .tUpdatedHash, , )
87+
If (tUpdatedHash '= tKnownHash) {
8888
//Clear out old data and flag the need for an update.
8989
Set tNeedsUpdate = 1
9090
&sql(delete from TestCoverage_Data.CodeUnitMap where ToHash = :tKnownHash)
@@ -247,7 +247,6 @@ ClassMethod GetCurrentByName(pInternalName As %String, pSourceNamespace As %Stri
247247
/// Fill in the LineIsPython property of .cls files
248248
Method UpdatePythonLines(pName As %String, ByRef pPyCodeUnit) As %Status
249249
{
250-
251250
Set tSC = $$$OK
252251
Set tOriginalNamespace = $Namespace
253252
Set tInitTLevel = $TLevel
@@ -543,8 +542,9 @@ Method UpdateComplexity() As %Status
543542

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

0 commit comments

Comments
 (0)