File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
src/semmle/javascript/frameworks
test/query-tests/filters/ClassifyFiles Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -213,13 +213,20 @@ Comment getExclamationPointCommentInRun(ExclamationPointComment head) {
213213 * Holds if this is a bundle containing multiple licenses.
214214 */
215215predicate isMultiLicenseBundle ( TopLevel tl ) {
216+ // case: comments preserved by minifiers
216217 count ( ExclamationPointComment head |
217218 head .getTopLevel ( ) = tl and
218219 exists ( ExclamationPointComment licenseIndicator |
219220 licenseIndicator = getExclamationPointCommentInRun ( head ) and
220221 licenseIndicator .getLine ( _) .regexpMatch ( "(?i).*\\b(copyright|license|\\d+\\.\\d+)\\b.*" )
221222 )
222223 ) > 1
224+ or
225+ // case: ordinary block comments with "@license" lines
226+ count ( BlockComment head |
227+ head .getTopLevel ( ) = tl and
228+ head .getLine ( _) .regexpMatch ( "(?i) *\\* @license .*" )
229+ ) > 1
223230}
224231
225232/**
Original file line number Diff line number Diff line change 1111| jsx.js:0:0:0:0 | jsx.js | generated |
1212| multi-part-bundle.html:0:0:0:0 | multi-part-bundle.html | generated |
1313| multi-part-bundle.js:0:0:0:0 | multi-part-bundle.js | generated |
14+ | multiple-licenses-2.js:0:0:0:0 | multiple-licenses-2.js | generated |
1415| multiple-licenses.js:0:0:0:0 | multiple-licenses.js | generated |
1516| opal-test.js:0:0:0:0 | opal-test.js | generated |
1617| peg-js.js:0:0:0:0 | peg-js.js | generated |
Original file line number Diff line number Diff line change 1+ /*
2+ * @copyright (c) ...
3+ * @copyright (c) ...
4+ * @license ...
5+ */
6+
7+ /**
8+ * @copyright ...
9+ * @license ...
10+ */
You can’t perform that action at this time.
0 commit comments