github-vet / github-vet/rangeloop-pointer-findings
odwrtw/polochon: modules/addicted/addicted.go; 8 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [odwrtw/polochon](https://www.github.com/odwrtw/polochon) at [modules/addicted/addicted.go](https://github.com/odwrtw/polochon/blob/1d18b9eb03c0ebfbf90606f4008a2e81cc48370d/modules/addicted/addicted.go#L142-L149)
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.
> reference to sub is reassigned at line 146
[Click here to see the code in its original context.](https://github.com/odwrtw/polochon/blob/1d18b9eb03c0ebfbf90606f4008a2e81cc48370d/modules/addicted/addicted.go#L142-L149)
Click here to show the 8 line(s) of Go which triggered the analyzer.
```go
for _, sub := range filteredSubs {
dist := levenshtein.ComputeDistance(strings.ToLower(reqEpisode.ReleaseGroup), strings.ToLower(sub.Release))
if dist < subDist {
subDist = dist
subtitle = &sub
release = sub.Release
}
}
```
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: 1d18b9eb03c0ebfbf90606f4008a2e81cc48370d
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with modules/addicted/addicted.go lines 142-149 at commit 1d18b9eb03c0ebfbf90606f4008a2e81cc48370d and inspect the surrounding use of the selected subtitle. Determine whether the analyzer's reference-to-sub reassignment represents a real bug, mitigated behavior, or desirable behavior; done means leaving the corresponding classification reaction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100