5th dnd – How can I determine the rarity / level of an object or a magic spell?

As far as I know, the DMG rules describe in his chart only the spell levels for spells involving damage. For magic items that do not follow spells, such as a scale that can expand or compress, that do not act in the same way, is there a way to find the rare or equivalent spell level? I will allow content outside the main books to be used in the answer.