Estou validando um codigo no codeanalysis porem, mesmo fazendo conforme orientação da TOTVS não consigo aprovação pelo codeanalysis. Poderiam me ajudar nesse exemplo abaixo:
Static Function fCols(cNomeTab,aCamposNao,cChave,cCondicao,nIndice,aCamposSim,cFiltro,cCpoCount,aHTMP)
Local nPos,nPosDesc,nPosComp, nQtdReg
Local oLeg := oLgVerde
Local aCTMP := {}
Local aCpoSX3 :={}
Local cX3Campo := ""
Local cCamposSim:=""
Local cSX3Tmp := GetNextAlias() //novo alias
OpenSXs(,,,,cEmpAnt, cSX3Tmp, "SX3",, .F.)
If Select(cSX3Tmp) > 0
If len(aCamposSim)>0
cCamposSim := ArrToStr(aCamposSim)
Endif
nQtdReg:=0
dbSelectArea(cNomeTab)
(cNomeTab)->(dbSetOrder(nIndice))
If dbseek(cChave)
While (cNomeTab)->(!EOF()) .And. &cCondicao
If !&cFiltro
(cNomeTab)->(dbSkip())
Loop
EndIf
nUsado:=1
nQtdReg++
AADD(aCTMP,Array(Len(aHTMP)+1))
DbSelectArea(cSX3Tmp) //posiciono no Alias do SX3
(cSX3Tmp)->(DbSetOrder(1))
(cSX3Tmp)->(DbSeek(cNomeTab))
While (cSX3Tmp)->X3_ARQUIVO == cNomeTab .and. !(cSX3Tmp)->(EOF())
cX3Campo:= AllTrim((cSX3Tmp)->X3_CAMPO)
If X3Uso(GetSx3Cache(cX3Campo, 'X3_USADO'))
If !Empty(cCamposSim)
If ! cX3Campo $ cCamposSim
Loop
Endif
Endif
nUsado++
If !Empty(cCpoCount) .And. AllTrim(cCpoCount) == AllTrim(cX3Campo)
aCTMP[Len(aCTMP)][nUsado] := StrZero(nQtdReg,3)
Else
if (cAlias)->X3_CONTEXT <> "V"
aCTMP[Len(aCTMP)][nUsado] := &(cNomeTab+"->"+cX3Campo)
Else
If cNomeTab == "SD4"
aCTMP[Len(aCTMP)][nUsado] := GetAdvFVal("SB1", "B1_DESC", xFilial("SB1")+SD4->D4_COD, 1, "")
Else
aCTMP[Len(aCTMP)][nUsado] := CriaVar(cX3Campo)
Endif
Endif
EndIf
Endif
If alltrim(cX3Campo) $ "D4_ZIDTRAN|H6_ZIDTRAN" .and. !Empty( (cNomeTab)->&(cX3Campo) )
aCTMP[Len(aCTMP)][01] := oLgAzul
ElseIf alltrim(cX3Campo) $ "D4_ZIDTRAN|H6_ZIDTRAN" .and. Empty( (cNomeTab)->&(cX3Campo) )
aCTMP[Len(aCTMP)][01] := oLgAmare
Endif
dbSkip()
End
aCTMP[Len(aCTMP)][nUsado+1] := .F.
dbSelectArea( cNomeTab )
dbSkip()
End
Else
nUsado:=1
AADD(aCTMP,Array(Len(aHTMP)+1))
aCTMP[Len(aCTMP)][nUsado] := oLgVerde
DbSelectArea(cSX3Tmp) //posiciono no Alias do SX3
(cSX3Tmp)->(DbSetOrder(1))
(cSX3Tmp)->(DbSeek(cNomeTab))
While (cSX3Tmp)->X3_ARQUIVO == cNomeTab .and. !(cSX3Tmp)->(EOF())
cX3Campo:= AllTrim((cSX3Tmp)->X3_CAMPO)
X3Uso(GetSx3Cache(cX3Campo, 'X3_USADO'))
If !Empty(cCamposSim)
If ! cX3Campo $ cCamposSim
Loop
Endif
Endif
nUsado++
aCTMP[Len(aCTMP)][nUsado] := CriaVar(cX3Campo)
Endif
dbSkip()
End
aCTMP[Len(aCTMP)][nUsado+1] := .F.
Endif
(cSX3Tmp)->(DbCloseArea())
Endif
Return aCTMP