8

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?

  • 2
    If you are using other code libraries in your project, keep a copy of the license. It will give you a good understanding of what the restrictions are. – richbai90 Jun 23 '15 at 21:25
  • 2
    You can only open source the code-base if you OWN the copyright. Your problem here is that you don't know provenance!. – Andrew Russell Jun 24 '15 at 0:34
  • 2
    Please give us your example scenario, there are too many possibilities to answer this correctly. – Andrew Russell Jun 24 '15 at 0:36
2

Yes, there are (paid) services such as Black Duck or Open Logic that will audit your code, and report all of the licensed pieces of software found.

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.

9

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.

  • 1
    There are services out there that determine this. Companies who use open source projects in their code under GPL licenses are not attractive candidates for buyouts, so there are services that scan the entire codebase and find pieces of code from the web and reports the license for each individual piece. I'm trying to remember the name of one such service. – Madara Uchiha Jun 24 '15 at 16:06
  • There are tools to search in foss code as @MadaraUchiha points, so even if it is hard to get to know if the code came from foss software, one can think it is proprietary after a thoghtful research – E. Celis Jun 24 '15 at 16:14
  • These comments reinforce my answer, or am I missing something? Those companies can do the diff because they have already "ingested" the baseline open source code (and attribution for the authors)... right? – rolfl Jun 24 '15 at 16:16
  • I am talking about the tools to search the code if it came from a foss project, not the companies that use and contribute to projects. – E. Celis Jun 24 '15 at 16:27
5

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.

1

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:

  1. 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.

  1. 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.