As mentioned in this comment the missing case for loc field needs to be handled.
The missing locations are in some cases intentional and the loc field in message pieces is optional.
So the missing case for that needs to be handled somehow, but there's no need to consider other fields as potentially missing. Depending on what Magpie allows, there are a few choices:
Completely ignore locationless messages.
If possible, output the message such that it's in the warnings list, but nowhere in the analyzed source code.
If the previous is not possible, then alternative might be to attach some location to it to have it show up somewhere.
As mentioned in this comment the missing case for
loc
field needs to be handled.