Is there a way to analyze my code I want to release as opensource to see if it is / or has parts that are already licensed or proprietary?
They will even find snippets in your code which are copy/pasted or too closely resemble snippets found on the internet which are shared with an unfavorable license.
If you do not know where your code came from (you did not write it, or you did not buy or license it), then there is no way for you to know its heritage. As a result, you cannot then open source it.
There is no way that I know of to analyse the code, and determine it's heritage unless you have already pre-analysed the code it may have come from (i.e. you can do a 'diff', but you need the baseline to compare to).
It is important when working with any code (open or not) to keep track of where the code comes from so that you can more easily make these determinations later.
I think you're under a slight misunderstanding of what a license is. A license is merely a grant of permission subject to certain conditions to use something that you otherwise couldn't, in this case under copyright law. Copyright law tells you who make grant that permission (the copyright holder, basically).
So in order to determine if you can grant permission to use the code under an open source license, you need to determine if you hold the copyright(s) to the code, or have been given permission by those who do.
If you wrote the code yourself, not based on someone else's code, and not as part of employment, then you probably own the copyright. As long as you haven't transferred the copyright to someone else (or given them an exclusive license, or otherwise agreed not to release the code), you can release it as open source.
If parts of the code were written by other people, then you probably need their permission to release the code (or to do much anything with it). If you downloaded it from somewhere, the license likely accompanied it, and may give you that permission. You will have to read its terms.
Otherwise, you need to contact all the authors and get each author's permission.
I've heard there are products that are used by large companies to scan their source code automatically, comparing portions against a large corpus of open-source code. They're intended to prevent one of their thousands of employees from copying open-source code into their proprietary apps (as that can give rise to a lot of liability for the company). But for a project with only a few developers, you can hopefully just trace all the code.
I don't see how just by looking at a piece of code you can figure out what license it uses. You wouldn't see this, for example:
// You'll never know the (license goes here) that I've made super secret from the world // and is hidden in this code. No one shall ever know, unless they come here of course... // Mua ha ha ha ha!
Concerning code, there are two ways that I see to determine the license it uses:
- Find the origin of the code:
Understanding the origin of the code will allow you to trace it to its roots, thereby connecting you to the original contributors or organization who wrote it. They would likely have the answer for you.
- Look at the documentation
Since documentation is code in english (at least in my eyes it is), there will likely be a mention of it there.