github-vet / github-vet/rangeloop-pointer-findings
udistrital/administrativa_mid_api: controllers/gestion_previnculaciones.go; 38 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [udistrital/administrativa_mid_api](https://www.github.com/udistrital/administrativa_mid_api) at [controllers/gestion_previnculaciones.go](https://github.com/udistrital/administrativa_mid_api/blob/7cfe6fb272a914b074c659d5cdc96572e559aaec/controllers/gestion_previnculaciones.go#L522-L559)
Below is the message reported by the analyzer for this snippet of code. Beware that the analyzer only reports the first issue it finds, so please do not limit your consideration to the contents of the below message.
>
[Click here to see the code in its original context.](https://github.com/udistrital/administrativa_mid_api/blob/7cfe6fb272a914b074c659d5cdc96572e559aaec/controllers/gestion_previnculaciones.go#L522-L559)
Click here to show the 38 line(s) of Go which triggered the analyzer.
```go
for x, pos := range vinc {
v = append(v, pos)
if resvinc.NivelAcademico == "PREGRADO" {
//Agrupa las modificaciones en la resolución por persona
pos.NumeroHorasModificacion, ValorModificacionContrato, pos.NumeroSemanasNuevas = Calcular_totales_vinculacion_pdf_nueva(pos.IdPersona, idResolucion, pos.IdDedicacion.Id)
pos.ValorModificacionFormato = FormatMoney(int(ValorModificacionContrato), 2)
pos.NumeroMesesNuevos = strconv.FormatFloat(float64(pos.NumeroSemanasNuevas)/4, 'f', 2, 64) + " meses"
//Agrupa las vinculaciones originales por persona
pos.NumeroHorasSemanales, pos.ValorContrato, pos.NumeroSemanas = Calcular_totales_vinculacion_pdf_nueva(pos.IdPersona, strconv.Itoa(modres[0].ResolucionAnterior), pos.IdDedicacion.Id)
pos.NumeroMeses = strconv.FormatFloat(float64(pos.NumeroSemanas)/4, 'f', 2, 64) + " meses"
pos.ValorContratoInicialFormato = FormatMoney(int(pos.ValorContrato), 2)
pos.NumeroHorasNuevas = pos.NumeroHorasSemanales - pos.NumeroHorasModificacion
pos.ValorContratoFormato = FormatMoney(int(pos.ValorContrato-ValorModificacionContrato), 2)
}
if resvinc.NivelAcademico == "POSGRADO" {
pos.NumeroHorasModificacion = pos.NumeroHorasSemanales
pos.ValorModificacionFormato = FormatMoney(int(pos.ValorContrato), 2)
pos.NumeroMesesNuevos = strconv.FormatFloat(float64(pos.NumeroSemanas)/4, 'f', 2, 64) + " meses"
ValorModificacionContrato = pos.ValorContrato
//Busca la vinculación original a la que está asociada la modificación
err = getJson(beego.AppConfig.String("ProtocolAdmin")+"://"+beego.AppConfig.String("UrlcrudAdmin")+"/"+beego.AppConfig.String("NscrudAdmin")+
"/modificacion_vinculacion/?query=VinculacionDocenteRegistrada:"+strconv.Itoa(pos.Id), &modvin)
if err != nil {
beego.Error(err)
c.Abort("400")
}
var vincOriginal = modvin[0].VinculacionDocenteCancelada
pos.NumeroHorasSemanales = vincOriginal.NumeroHorasSemanales
pos.NumeroMeses = strconv.FormatFloat(float64(vincOriginal.NumeroSemanas)/4, 'f', 2, 64) + " meses"
pos.ValorContratoInicialFormato = FormatMoney(int(vincOriginal.ValorContrato), 2)
pos.NumeroHorasNuevas = vincOriginal.NumeroHorasSemanales - pos.NumeroHorasModificacion
pos.ValorContratoFormato = FormatMoney(int(vincOriginal.ValorContrato-ValorModificacionContrato), 2)
}
llenarVinculacion(&pos)
v[x] = pos
}
```
Click here to show extra information the analyzer produced.
```
No path was found through the callgraph that could lead to a function which writes a pointer argument.
No path was found through the callgraph that could lead to a function which passes a pointer to third-party code.
root signature {llenarVinculacion 1} was not found in the callgraph; reference was passed directly to third-party code
```
Leave a reaction on this issue to contribute to the project by classifying this instance as a **Bug** :-1:, **Mitigated** :+1:, or **Desirable Behavior** :rocket:
See the descriptions of the classifications [here](https://github.com/github-vet/rangeclosure-findings#how-can-i-help) for more information.
commit ID: 7cfe6fb272a914b074c659d5cdc96572e559aaec
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.