SIGN IN SIGN UP
tw93 / Mole UNCLAIMED

🐹 Deep clean and optimize your Mac.

0 0 83 Shell

fix(status): improve battery health percentage accuracy (#991)

* fix(status): prefer AppleSmartBattery health capacity

* chore(status): apply gofmt to battery metrics

Var block alignment was off, causing gofmt -l to flag the file.

* fix(status): bound ioreg CycleCount via strconv.Atoi

CodeQL go/incorrect-integer-conversion flagged the float64-to-int
cast on line 237. The literal "value < 100000" guard wasn't enough
for the analyzer to prove the conversion was safe. Switching to
ioRegValueForKey + strconv.Atoi yields an int directly, no cast.

---------

Co-authored-by: Tw93 <hitw93@gmail.com>
M
Manuel Guido committed
308af1889f93f28f52729a1bcfbd04bde0cd1faa
Parent: 28ca148
Committed by GitHub <noreply@github.com> on 5/28/2026, 1:10:53 AM