Licence isn't some property of code, it's a [offer of] contract between you and somebody else, where you grant them licence to use your copyrighted item under some condictions.
First, you may do whatever you want with the code as long as it's only yours.
Second, any piece of code may have multiple licences attached to it depending on how and to whom the author has distributed it. You may have the exact same code with one licence available to everyone, with another (more permissive) licence to people who pay you money for those extra permissions, and a completely different licence to a single specific company. The permissions depend your relations/agreements with the other party, not only on the code itself.
Third, for any licence of any code, it's conditions apply to you only if you need the licence to grant you some permission - i.e., if you want to modify&distribute something where someone else owns the copyright. (Or you have a specific signed contract, but that's more common in B2B enterprise issues). If you want to do something where you don't need permission - the licence doesn't [need to] apply.
Fourth, for software do note that many things change if multiple people are authors of parts of it - e.g., if other people make small improvements and want to redistribute the combined project. Then the result is not your code anymore (e.g., it's not 100% yours), and in order to make it work, you need to take a look at the software-specific licences (not the creative commons family) which handle those issues as well.