fix(hermes): This localized change reduces parseUSBScratchFstab's cognitive complexity by two, from 17 to the allowed 15, without changing source parsing behavior. (incident sonar/metis/go:S3776/AZ2z_XbbKy9i4pkIqvM9)

This commit is contained in:
Hermes Agent 2026-08-07 04:17:47 +00:00
parent d7a1dc0b74
commit c6afc7a3b2

View File

@ -157,12 +157,8 @@ func parseUSBScratchFstab(raw string) (*usbScratchConfig, bool) {
}
cfg.Mountpoint = target
cfg.FS = fsType
if value, ok := strings.CutPrefix(source, "UUID="); ok {
cfg.UUID = value
}
if value, ok := strings.CutPrefix(source, "LABEL="); ok {
cfg.Label = value
}
cfg.UUID, _ = strings.CutPrefix(source, "UUID=")
cfg.Label, _ = strings.CutPrefix(source, "LABEL=")
}
if cfg.Mountpoint == "" {
return nil, false