First as many where, I am not a lawyer. But, AFAICT the answer is both "Yes" and "No"
The TL;DR version is if you modify the code then no. For example you take some C++ code and you compile it. The compiled code is a modified version of the code you took. As such your project has to be released under the same license. Conversely if you take some JavaScript, you do NOT run it through a builder so it stays the same code, and you just include it via a script tag or an import statement then it's likely ok of course with proper attribution.
Examples from the Creative Commons organization that suggests this conclusion.
From the actual license
3.b
ShareAlike.
In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply.
- The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License.
- You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.
- You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.
And from the defintions in the same license
Section 1 – Definitions.
a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
c. BY-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License.
d. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
For example say you have a website, you put a CC-BY-SA image on the site. The image itself is unmodified, you've given the required attribution, people are free to download the image from you and continue to use it a CC-BY-SA.
Similarly would be a library marked as CC-BY-SA. You use that library without modification and give correct attribution. Does the rest of your app or site now have to be CC-BY-SA?
The wiki link above says
The ShareAlike licenses require that licensees make their contributions to adapted material available under the same terms and conditions
Adding a single image to one article in a 50 page website is not "making their contributions to adapted material". Editing the picture is "making their contributions to adapted material" and if it was code then adding feature or fixing bugs is "making their contributions to adapted material" but not using the library as "making their contributions to adapted material"
The actual license says CC-BY-SA is required when ...
in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights
A single CC-BY-SA image in a large website or using a CC-BY-SA library is not
- translated (no, nothing was translated)
- altered (it has not been altered it)
- transformed (it has not transformed)
- or otherwise modified (it has not been modified)
That leaves arranged . Arranging seems to be related to musical scores since CC was designed for art/music/video and not code.
Some other examples from the Creative Commons site that make this more clear
Yes. All CC licenses allow redistribution of the unmodified material by any means, including distribution via file-sharing networks.
So yes, including some CC-BY-SA content on a site does not infect all the other content.
... Generally, a modification rises to the level of an adaptation under copyright law when the modified work is based on the prior work but manifests sufficient new creativity to be copyrightable, such as a translation of a novel from one language to another, or the creation of a screenplay based on a novel.
... Under CC licenses, synching music in timed relation with a moving image is always considered an adaptation, whether or not it would be considered so under applicable law.
I called out music there to show it's special but otherwise putting an unmodified image or using an unmodified library doesn't fit the defintion of adaptation above.
... If the combination does not create an adaptation, then you may combine any CC-licensed content so long as you provide attribution and comply with the NonCommercial restriction if it applies ...
Combining the last 2 paragraphs CC-BY-SA is more like LGPL than GPL. In other words if you link to it (via script or import) then you're okay. If you compile it or link with it you're not ok
All Creative Commons licenses (including the version 4.0 licenses) allow licensed material to be included in collections such as anthologies, encyclopedias, and broadcasts. You may choose a license for the collection, however this does not change the license applicable to the original material.
It further goes on to show commercial collections are ok to include CC-BY-SA items but that particlar item stays CC-BY-SA.
CC was arguably designed for traditionally creative works (art, music, video) and hence the name "creative" commons. It's unfortuante that S.O. choose CC when CC themsevles recommend against it though I suspect that recommendation came after S.O. started using the license.
We recommend against using Creative Commons licenses for software. Instead, we strongly encourage you to use one of the very good software licenses which are already available. We recommend considering licenses listed as free by the Free Software Foundation and listed as “open source” by the Open Source Initiative.
Also note apparently at least one judge has ruled, for example, that putting a CC-BY-SA photo on the cover of your book does not require your book to by CC-BY-SA
https://opensource.stackexchange.com/a/8364/16125