@jip While I agree in principle with the idea of having simple checks for a secondary weapon where that weapon's effect is negligible, I'd disagree with making it as broad as 'if it's not the primary purpose then downgrade it'.
As an example, you mention cruisers with direct fire weapons. Sometimes I will build a Cybran cruiser for the primary purpose of using its direct fire weapon, since on some maps it's the optimal unit for taking out a firebase (although having said that I dont actually know what its default priorities are so maybe it wouldnt make much difference).
Seraphim sub hunters would be another example where you might build them both for the AA and for the anti-sub capabilities.
Other examples where you might build a unit for a combination of its weapons/non-primary purpose would be restorers, and in theory continentals (although in practice they're a bit too weak to use efficiently as a combat unit that can also sometimes transport units)
I'd therefore suggest a stricter threshold, where the weapon must both be a secondary purpose, and also be very bad at that secondary purpose. So for example a fatboy's anti-air or a transport's air to ground would fall into that category, but a Seraphim sub hunter's AA or a Cybran cruiser's direct fire attack wouldnt.