diff --git a/src/licensedcode/models.py b/src/licensedcode/models.py index b0274b74902..abe38fa31f4 100644 --- a/src/licensedcode/models.py +++ b/src/licensedcode/models.py @@ -953,6 +953,10 @@ def validate(self, licensing=None): except InvalidRule as e: yield f'Failed to parse and validate license_expression: {e}' + if self.referenced_filenames: + if len(set(self.referenced_filenames)) != len(self.referenced_filenames): + yield 'referenced_filenames cannot contain duplicates.' + def license_keys(self, unique=True): """ Return a list of license keys for this rule. diff --git a/src/licensedcode/plugin_license.py b/src/licensedcode/plugin_license.py index 6146209458a..1845ebedc2e 100644 --- a/src/licensedcode/plugin_license.py +++ b/src/licensedcode/plugin_license.py @@ -11,6 +11,7 @@ import attr +from commoncode import fileutils from commoncode.cliutils import PluggableCommandLineOption from plugincode.scan import ScanPlugin from plugincode.scan import scan_impl @@ -116,3 +117,73 @@ def get_scanner( license_text_diagnostics=license_text_diagnostics, license_url_template=license_url_template ) + + def process_codebase(self, codebase, **kwargs): + + if codebase.has_single_resource: + return + + for resource in codebase.walk(topdown=False): + match_reference_license(resource,codebase) + + +def match_reference_license(resource, codebase): + """ + Return the ``resource`` Resource updating and saving it in place, after adding new + license matches (licenses and license_expressions) following their Rule + ``referenced_filenames`` if any. Return None if this is not a file Resource. + """ + if not resource.is_file: + return + + licenses = resource.licenses + license_expressions = resource.license_expressions + if not licenses: + return + + referenced_licenses = [] + referenced_license_expressions = [] + referenced_filenames = get_referenced_filenames(licenses) + modified = False + + for referenced_filename in referenced_filenames: + new_resource = find_referenced_resource(referenced_filename=referenced_filename, resource=resource, codebase=codebase) + if new_resource: + modified = True + referenced_licenses.extend(new_resource.licenses) + referenced_license_expressions.extend(new_resource.license_expressions) + + licenses.extend(referenced_licenses) + license_expressions.extend(referenced_license_expressions) + + if modified: + codebase.save_resource(resource) + return resource + + +def get_referenced_filenames(license_matches): + """ + Return a list of unique referenced filenames found in the rules of a list of ``license_matches`` + """ + referenced_filenames = [] + for license_match in license_matches: + referenced_files = license_match['matched_rule']['referenced_filenames'] + for referenced_filename in referenced_files: + if not referenced_filename in referenced_filenames: + referenced_filenames.append(referenced_filename) + + return referenced_filenames + + +def find_referenced_resource(referenced_filename, resource, codebase, **kwargs): + """ + Return a Resource matching the ``referenced_filename`` path or filename given a ``resource`` in ``codebase``. + Return None if the ``referenced_filename`` cannot be found in the same directory as the base ``resource``. + ``referenced_filename`` is the path or filename referenced in a LicenseMatch of ``resource``, + """ + parent = resource.parent(codebase) + + for child in parent.children(codebase): + path = child.path + if path.endswith(referenced_filename) or fileutils.file_base_name(child.path) == referenced_filename: + return child diff --git a/tests/licensedcode/data/plugin_license/license_reference/scan-ref.expected.json b/tests/licensedcode/data/plugin_license/license_reference/scan-ref.expected.json new file mode 100644 index 00000000000..f5617f1cec1 --- /dev/null +++ b/tests/licensedcode/data/plugin_license/license_reference/scan-ref.expected.json @@ -0,0 +1,165 @@ +{ + "headers": [ + { + "tool_name": "scancode-toolkit", + "options": { + "input": "", + "--json": "", + "--license": true, + "--license-text": true, + "--license-text-diagnostics": true, + "--strip-root": true + }, + "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "message": null, + "errors": [], + "extra_data": { + "files_count": 2 + } + } + ], + "files": [ + { + "path": "LICENSE", + "type": "file", + "licenses": [ + { + "key": "mit", + "score": 100.0, + "name": "MIT License", + "short_name": "MIT License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "MIT", + "homepage_url": "http://opensource.org/licenses/mit-license.php", + "text_url": "http://opensource.org/licenses/mit-license.php", + "reference_url": "https://scancode-licensedb.aboutcode.org/mit", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/mit.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/mit.yml", + "spdx_license_key": "MIT", + "spdx_url": "https://spdx.org/licenses/MIT", + "start_line": 1, + "end_line": 1, + "matched_rule": { + "identifier": "mit_66.RULE", + "license_expression": "mit", + "licenses": [ + "mit" + ], + "referenced_filenames": [], + "is_license_text": false, + "is_license_notice": true, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "1-hash", + "rule_length": 10, + "matched_length": 10, + "match_coverage": 100.0, + "rule_relevance": 100 + }, + "matched_text": "that is licensed under [MIT](http://opensource.org/licenses/MIT)." + } + ], + "license_expressions": [ + "mit" + ], + "percentage_of_license_text": 100.0, + "scan_errors": [] + }, + { + "path": "license-notice.txt", + "type": "file", + "licenses": [ + { + "key": "unknown-license-reference", + "score": 27.0, + "name": "Unknown License file reference", + "short_name": "Unknown License reference", + "category": "Unstated License", + "is_exception": false, + "is_unknown": true, + "owner": "Unspecified", + "homepage_url": null, + "text_url": "", + "reference_url": "https://scancode-licensedb.aboutcode.org/unknown-license-reference", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/unknown-license-reference.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/unknown-license-reference.yml", + "spdx_license_key": "LicenseRef-scancode-unknown-license-reference", + "spdx_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/unknown-license-reference.LICENSE", + "start_line": 34, + "end_line": 34, + "matched_rule": { + "identifier": "unknown-license-reference_25.RULE", + "license_expression": "unknown-license-reference", + "licenses": [ + "unknown-license-reference" + ], + "referenced_filenames": [ + "LICENSE" + ], + "is_license_text": false, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": true, + "is_license_intro": false, + "has_unknown": true, + "matcher": "2-aho", + "rule_length": 5, + "matched_length": 5, + "match_coverage": 100.0, + "rule_relevance": 27 + }, + "matched_text": "license\": \"SEE LICENSE IN LICENSE." + }, + { + "key": "mit", + "score": 100.0, + "name": "MIT License", + "short_name": "MIT License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "MIT", + "homepage_url": "http://opensource.org/licenses/mit-license.php", + "text_url": "http://opensource.org/licenses/mit-license.php", + "reference_url": "https://scancode-licensedb.aboutcode.org/mit", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/mit.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/mit.yml", + "spdx_license_key": "MIT", + "spdx_url": "https://spdx.org/licenses/MIT", + "start_line": 1, + "end_line": 1, + "matched_rule": { + "identifier": "mit_66.RULE", + "license_expression": "mit", + "licenses": [ + "mit" + ], + "referenced_filenames": [], + "is_license_text": false, + "is_license_notice": true, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "1-hash", + "rule_length": 10, + "matched_length": 10, + "match_coverage": 100.0, + "rule_relevance": 100 + }, + "matched_text": "that is licensed under [MIT](http://opensource.org/licenses/MIT)." + } + ], + "license_expressions": [ + "unknown-license-reference", + "mit" + ], + "percentage_of_license_text": 0.2, + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/licensedcode/data/plugin_license/license_reference/scan-wref.expected.json b/tests/licensedcode/data/plugin_license/license_reference/scan-wref.expected.json new file mode 100644 index 00000000000..73692b40070 --- /dev/null +++ b/tests/licensedcode/data/plugin_license/license_reference/scan-wref.expected.json @@ -0,0 +1,75 @@ +{ + "headers": [ + { + "tool_name": "scancode-toolkit", + "options": { + "input": "", + "--json": "", + "--license": true, + "--license-text": true, + "--license-text-diagnostics": true, + "--strip-root": true + }, + "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "message": null, + "errors": [], + "extra_data": { + "files_count": 1 + } + } + ], + "files": [ + { + "path": "license-notice.txt", + "type": "file", + "licenses": [ + { + "key": "unknown-license-reference", + "score": 27.0, + "name": "Unknown License file reference", + "short_name": "Unknown License reference", + "category": "Unstated License", + "is_exception": false, + "is_unknown": true, + "owner": "Unspecified", + "homepage_url": null, + "text_url": "", + "reference_url": "https://scancode-licensedb.aboutcode.org/unknown-license-reference", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/unknown-license-reference.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/unknown-license-reference.yml", + "spdx_license_key": "LicenseRef-scancode-unknown-license-reference", + "spdx_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/unknown-license-reference.LICENSE", + "start_line": 34, + "end_line": 34, + "matched_rule": { + "identifier": "unknown-license-reference_25.RULE", + "license_expression": "unknown-license-reference", + "licenses": [ + "unknown-license-reference" + ], + "referenced_filenames": [ + "LICENSE" + ], + "is_license_text": false, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": true, + "is_license_intro": false, + "has_unknown": true, + "matcher": "2-aho", + "rule_length": 5, + "matched_length": 5, + "match_coverage": 100.0, + "rule_relevance": 27 + }, + "matched_text": "license\": \"SEE LICENSE IN LICENSE." + } + ], + "license_expressions": [ + "unknown-license-reference" + ], + "percentage_of_license_text": 0.2, + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/licensedcode/data/plugin_license/license_reference/scan/scan-ref/LICENSE b/tests/licensedcode/data/plugin_license/license_reference/scan/scan-ref/LICENSE new file mode 100644 index 00000000000..76b4a2d54bb --- /dev/null +++ b/tests/licensedcode/data/plugin_license/license_reference/scan/scan-ref/LICENSE @@ -0,0 +1 @@ +that is licensed under [MIT](http://opensource.org/licenses/MIT). \ No newline at end of file diff --git a/tests/licensedcode/data/plugin_license/license_reference/scan/scan-ref/license-notice.txt b/tests/licensedcode/data/plugin_license/license_reference/scan/scan-ref/license-notice.txt new file mode 100644 index 00000000000..3e4a9a96e69 --- /dev/null +++ b/tests/licensedcode/data/plugin_license/license_reference/scan/scan-ref/license-notice.txt @@ -0,0 +1,977 @@ +{ + "preview": true, + "name": "mongodb-vscode", + "displayName": "MongoDB for VS Code", + "description": "Connect to MongoDB and Atlas directly from your VS Code environment, navigate your databases and collections, inspect your schema and use playgrounds to prototype queries and aggregations.", + "version": "0.0.0-dev.0", + "homepage": "https://github.com/mongodb-js/vscode", + "qna": "https://developer.mongodb.com/community/forums/", + "repository": { + "type": "git", + "url": "https://github.com/mongodb-js/vscode" + }, + "bugs": { + "url": "https://github.com/mongodb-js/vscode/issues", + "email": "vscode@mongodb.com" + }, + "publisher": "mongodb", + "categories": [ + "Programming Languages", + "Snippets", + "Other" + ], + "keywords": [ + "MongoDB", + "MongoDB Atlas", + "MQL", + "Databases" + ], + "icon": "images/mongodb.png", + "galleryBanner": { + "color": "#3D4F58", + "theme": "dark" + }, + "license": "SEE LICENSE IN LICENSE.txt", + "main": "./dist/extension.js", + "scripts": { + "clean": "rimraf ./out/* ./dist/* ", + "lint": "eslint --cache '**/*.{js,ts,tsx}'", + "update-grammar": "ts-node ./scripts/update-grammar.ts", + "update-snippets": "ts-node ./scripts/update-snippets.ts", + "precompile": "npm run clean", + "compile": "npm-run-all compile:*", + "compile:keyfile": "ts-node ./scripts/generate-keyfile.ts", + "compile:resources": "npm run update-grammar && npm run update-snippets", + "compile:extension": "tsc -p ./", + "compile:extension-bundles": "webpack --mode development", + "watch": "npm run compile && npm-run-all -p watch:*", + "watch:extension": "npm run compile:extension -- -watch", + "watch:extension-bundles": "webpack --mode development --info-verbosity verbose --watch", + "pretest": "npm run compile && cross-env MONGODB_VERSION=4.2.3 mongodb-runner start --port=27018", + "test": "npm run test-webview && npm run test-extension", + "test-extension": "cross-env NODE_OPTIONS=--no-force-async-hooks-checks xvfb-maybe node ./out/test/runTest.js", + "test-webview": "jest", + "posttest": "mongodb-runner stop --port=27018", + "vscode:prepublish": "npm run clean && npm run compile:keyfile && npm run compile:resources && webpack --mode production", + "check": "npm run lint && npm run check-dependencies", + "check-dependencies": "depcheck --ignores='vscode,keytar,@types/jest,mocha-junit-reporter,mocha-multi,pre-commit,webpack-cli,vscode-languageserver-textdocument,@babel/core'", + "package": "npm list --production --parseable --depth=99999 --loglevel=info || true && cross-env NODE_OPTIONS=\"--require ./scripts/no-npm-list-fail.js\" vsce package --githubBranch main", + "local-install": "npm run package && code --install-extension ./mongodb-vscode-*.vsix", + "check-vsix-size": "ts-node ./scripts/check-vsix-size.ts", + "release-draft": "node ./scripts/release-draft.js" + }, + "engines": { + "vscode": "^1.58.1", + "node": "^14.17.3", + "npm": "^7.19.0" + }, + "activationEvents": [ + "onCommand:mdb.connect", + "onCommand:mdb.connectWithURI", + "onCommand:mdb.openOverviewPage", + "onCommand:mdb.createPlayground", + "onCommand:mdb.addConnection", + "onCommand:mdb.addConnectionWithURI", + "onCommand:mdb.disconnect", + "onCommand:mdb.removeConnection", + "onCommand:mdb.openMongoDBShell", + "onCommand:mdb.saveMongoDBDocument", + "onView:mongoDB", + "onView:mongoDBConnectionExplorer", + "onView:mongoDBPlaygroundsExplorer", + "onLanguage:json", + "onLanguage:mongodb" + ], + "contributes": { + "viewsContainers": { + "activitybar": [ + { + "id": "mongoDB", + "title": "MongoDB", + "icon": "images/sidebar-leaf.svg" + } + ] + }, + "views": { + "mongoDB": [ + { + "id": "mongoDBConnectionExplorer", + "name": "Connections", + "when": "config.mdb.showMongoDBConnectionExplorer == true" + }, + { + "id": "mongoDBPlaygroundsExplorer", + "name": "Playgrounds", + "when": "config.mdb.showMongoDBPlaygrounds == true" + }, + { + "id": "mongoDBHelpExplorer", + "name": "Help and Feedback", + "when": "config.mdb.showMongoDBHelpExplorer == true" + } + ] + }, + "viewsWelcome": [ + { + "view": "mongoDBConnectionExplorer", + "contents": "No connections found.\n[Add Connection](command:mdb.connect)" + }, + { + "view": "mongoDBPlaygroundsExplorer", + "contents": "No '.mongodb' playground files found in the workspace.\n[Create New Playground](command:mdb.createNewPlaygroundFromPlaygroundExplorer)" + } + ], + "languages": [ + { + "id": "mongodb", + "aliases": [ + "MongoDB", + "mongodb" + ], + "extensions": [ + ".mongodb" + ], + "configuration": "./languages/mongodb-language-configuration.json" + }, + { + "id": "terraform", + "aliases": [ + "Terraform", + "terraform" + ], + "extensions": [ + ".tf" + ] + } + ], + "grammars": [ + { + "language": "mongodb", + "path": "./syntaxes/mongodb.tmLanguage.json", + "scopeName": "source.mongodb" + } + ], + "snippets": [ + { + "language": "mongodb", + "path": "./snippets/stage-autocompleter.json" + }, + { + "language": "terraform", + "path": "./snippets/atlas-terraform.json" + } + ], + "commands": [ + { + "command": "mdb.connect", + "title": "MongoDB: Connect" + }, + { + "command": "mdb.connectWithURI", + "title": "MongoDB: Connect with Connection String..." + }, + { + "command": "mdb.disconnect", + "title": "MongoDB: Disconnect" + }, + { + "command": "mdb.removeConnection", + "title": "MongoDB: Remove Connection..." + }, + { + "command": "mdb.openOverviewPage", + "title": "MongoDB: Open Overview Page" + }, + { + "command": "mdb.openMongoDBShell", + "title": "MongoDB: Launch MongoDB Shell" + }, + { + "command": "mdb.treeViewOpenMongoDBShell", + "title": "Launch MongoDB Shell" + }, + { + "command": "mdb.createPlayground", + "title": "MongoDB: Create MongoDB Playground" + }, + { + "command": "mdb.refreshPlaygrounds", + "title": "MongoDB: Refresh Playgrounds List" + }, + { + "command": "mdb.refreshPlaygroundsFromTreeView", + "title": "Refresh", + "icon": { + "light": "images/light/refresh.svg", + "dark": "images/dark/refresh.svg" + } + }, + { + "command": "mdb.createNewPlaygroundFromViewAction", + "title": "Create MongoDB Playground" + }, + { + "command": "mdb.createNewPlaygroundFromOverviewPage", + "title": "Create MongoDB Playground" + }, + { + "command": "mdb.createNewPlaygroundFromPlaygroundExplorer", + "title": "Create MongoDB Playground", + "icon": { + "light": "images/light/add.svg", + "dark": "images/dark/add.svg" + } + }, + { + "command": "mdb.changeActiveConnection", + "title": "MongoDB: Change Active Connection" + }, + { + "command": "mdb.runSelectedPlaygroundBlocks", + "title": "MongoDB: Run Selected Lines From Playground" + }, + { + "command": "mdb.saveMongoDBDocument", + "title": "MongoDB: Save Document To MongoDB" + }, + { + "command": "mdb.runAllPlaygroundBlocks", + "title": "MongoDB: Run All From Playground" + }, + { + "command": "mdb.runPlayground", + "title": "MongoDB: Run All or Selection From Playground", + "icon": { + "light": "images/light/play.svg", + "dark": "images/dark/play.svg" + } + }, + { + "command": "mdb.addConnection", + "title": "Add MongoDB Connection", + "icon": { + "light": "images/light/add.svg", + "dark": "images/dark/add.svg" + } + }, + { + "command": "mdb.addConnectionWithURI", + "title": "Add MongoDB Connection with Connection String...", + "icon": { + "light": "images/light/add.svg", + "dark": "images/dark/add.svg" + } + }, + { + "command": "mdb.copyConnectionString", + "title": "Copy Connection String" + }, + { + "command": "mdb.renameConnection", + "title": "Rename Connection..." + }, + { + "command": "mdb.treeItemRemoveConnection", + "title": "Remove Connection..." + }, + { + "command": "mdb.addDatabase", + "title": "Add Database...", + "icon": { + "light": "images/light/plus-circle.svg", + "dark": "images/dark/plus-circle.svg" + } + }, + { + "command": "mdb.searchForDocuments", + "title": "Search For Documents...", + "icon": { + "light": "images/light/search-regular.svg", + "dark": "images/dark/search-regular.svg" + } + }, + { + "command": "mdb.openPlaygroundFromTreeItem", + "title": "Open Playground" + }, + { + "command": "mdb.connectToConnectionTreeItem", + "title": "Connect" + }, + { + "command": "mdb.disconnectFromConnectionTreeItem", + "title": "Disconnect" + }, + { + "command": "mdb.refreshConnection", + "title": "Refresh" + }, + { + "command": "mdb.copyDatabaseName", + "title": "Copy Database Name" + }, + { + "command": "mdb.dropDatabase", + "title": "Drop Database..." + }, + { + "command": "mdb.refreshDatabase", + "title": "Refresh" + }, + { + "command": "mdb.addCollection", + "title": "Add Collection...", + "icon": { + "light": "images/light/plus-circle.svg", + "dark": "images/dark/plus-circle.svg" + } + }, + { + "command": "mdb.viewCollectionDocuments", + "title": "View Documents" + }, + { + "command": "mdb.refreshDocumentList", + "title": "Refresh", + "icon": { + "light": "images/light/refresh.svg", + "dark": "images/dark/refresh.svg" + } + }, + { + "command": "mdb.copyCollectionName", + "title": "Copy Collection Name" + }, + { + "command": "mdb.dropCollection", + "title": "Drop Collection..." + }, + { + "command": "mdb.refreshCollection", + "title": "Refresh" + }, + { + "command": "mdb.refreshSchema", + "title": "Refresh" + }, + { + "command": "mdb.copySchemaFieldName", + "title": "Copy Field Name" + }, + { + "command": "mdb.refreshIndexes", + "title": "Refresh" + }, + { + "command": "mdb.createIndexFromTreeView", + "title": "Create New Index...", + "icon": { + "light": "images/light/plus-circle.svg", + "dark": "images/dark/plus-circle.svg" + } + }, + { + "command": "mdb.startStreamLanguageServerLogs", + "title": "LSP Inspector: Start Stream LSP Logs" + } + ], + "menus": { + "view/title": [ + { + "command": "mdb.createNewPlaygroundFromViewAction", + "when": "view == mongoDBPlaygroundsExplorer" + }, + { + "command": "mdb.createNewPlaygroundFromPlaygroundExplorer", + "when": "view == mongoDBPlaygroundsExplorer", + "group": "navigation@1" + }, + { + "command": "mdb.refreshPlaygroundsFromTreeView", + "when": "view == mongoDBPlaygroundsExplorer", + "group": "navigation@5" + }, + { + "command": "mdb.addConnection", + "when": "view == mongoDBConnectionExplorer", + "group": "navigation@1" + }, + { + "command": "mdb.addConnection", + "when": "view == mongoDBConnectionExplorer" + }, + { + "command": "mdb.addConnectionWithURI", + "when": "view == mongoDBConnectionExplorer" + } + ], + "view/item/context": [ + { + "command": "mdb.addDatabase", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "inline" + }, + { + "command": "mdb.addDatabase", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "1@1" + }, + { + "command": "mdb.refreshConnection", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "1@2" + }, + { + "command": "mdb.treeViewOpenMongoDBShell", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "2@1" + }, + { + "command": "mdb.renameConnection", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "3@1" + }, + { + "command": "mdb.copyConnectionString", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "4@1" + }, + { + "command": "mdb.disconnectFromConnectionTreeItem", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "5@1" + }, + { + "command": "mdb.treeItemRemoveConnection", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "5@2" + }, + { + "command": "mdb.openPlaygroundFromTreeItem", + "when": "view == mongoDBPlaygroundsExplorer && viewItem == playgroundsTreeItem", + "group": "1@1" + }, + { + "command": "mdb.connectToConnectionTreeItem", + "when": "view == mongoDBConnectionExplorer && viewItem == disconnectedConnectionTreeItem", + "group": "1@1" + }, + { + "command": "mdb.renameConnection", + "when": "view == mongoDBConnectionExplorer && viewItem == disconnectedConnectionTreeItem", + "group": "2@1" + }, + { + "command": "mdb.copyConnectionString", + "when": "view == mongoDBConnectionExplorer && viewItem == disconnectedConnectionTreeItem", + "group": "3@1" + }, + { + "command": "mdb.treeItemRemoveConnection", + "when": "view == mongoDBConnectionExplorer && viewItem == disconnectedConnectionTreeItem", + "group": "4@1" + }, + { + "command": "mdb.addCollection", + "when": "view == mongoDBConnectionExplorer && viewItem == databaseTreeItem", + "group": "inline" + }, + { + "command": "mdb.addCollection", + "when": "view == mongoDBConnectionExplorer && viewItem == databaseTreeItem", + "group": "1@1" + }, + { + "command": "mdb.refreshDatabase", + "when": "view == mongoDBConnectionExplorer && viewItem == databaseTreeItem", + "group": "1@2" + }, + { + "command": "mdb.copyDatabaseName", + "when": "view == mongoDBConnectionExplorer && viewItem == databaseTreeItem", + "group": "2@1" + }, + { + "command": "mdb.dropDatabase", + "when": "view == mongoDBConnectionExplorer && viewItem == databaseTreeItem", + "group": "3@1" + }, + { + "command": "mdb.viewCollectionDocuments", + "when": "view == mongoDBConnectionExplorer && viewItem == collectionTreeItem", + "group": "1@1" + }, + { + "command": "mdb.refreshCollection", + "when": "view == mongoDBConnectionExplorer && viewItem == collectionTreeItem", + "group": "1@2" + }, + { + "command": "mdb.copyCollectionName", + "when": "view == mongoDBConnectionExplorer && viewItem == collectionTreeItem", + "group": "2@1" + }, + { + "command": "mdb.dropCollection", + "when": "view == mongoDBConnectionExplorer && viewItem == collectionTreeItem", + "group": "3@1" + }, + { + "command": "mdb.searchForDocuments", + "when": "view == mongoDBConnectionExplorer && viewItem == documentListTreeItem", + "group": "inline" + }, + { + "command": "mdb.refreshDocumentList", + "when": "view == mongoDBConnectionExplorer && viewItem == documentListTreeItem", + "group": "inline" + }, + { + "command": "mdb.viewCollectionDocuments", + "when": "view == mongoDBConnectionExplorer && viewItem == documentListTreeItem" + }, + { + "command": "mdb.refreshDocumentList", + "when": "view == mongoDBConnectionExplorer && viewItem == documentListTreeItem" + }, + { + "command": "mdb.searchForDocuments", + "when": "view == mongoDBConnectionExplorer && viewItem == documentListTreeItem", + "group": "2@1" + }, + { + "command": "mdb.refreshSchema", + "when": "view == mongoDBConnectionExplorer && viewItem == schemaTreeItem" + }, + { + "command": "mdb.copySchemaFieldName", + "when": "view == mongoDBConnectionExplorer && viewItem == fieldTreeItem" + }, + { + "command": "mdb.createIndexFromTreeView", + "when": "view == mongoDBConnectionExplorer && viewItem == indexListTreeItem", + "group": "inline" + }, + { + "command": "mdb.refreshIndexes", + "when": "view == mongoDBConnectionExplorer && viewItem == indexListTreeItem" + }, + { + "command": "mdb.createIndexFromTreeView", + "when": "view == mongoDBConnectionExplorer && viewItem == indexListTreeItem" + } + ], + "editor/title": [ + { + "command": "mdb.runPlayground", + "group": "navigation", + "when": "editorLangId == mongodb" + } + ], + "commandPalette": [ + { + "command": "mdb.saveMongoDBDocument", + "when": "editorLangId == json" + }, + { + "command": "mdb.runSelectedPlaygroundBlocks", + "when": "editorLangId == mongodb" + }, + { + "command": "mdb.runAllPlaygroundBlocks", + "when": "editorLangId == mongodb" + }, + { + "command": "mdb.refreshPlaygroundsFromTreeView", + "when": "false" + }, + { + "command": "mdb.searchForDocuments", + "when": "false" + }, + { + "command": "mdb.addConnection", + "when": "false" + }, + { + "command": "mdb.addConnectionWithURI", + "when": "false" + }, + { + "command": "mdb.createNewPlaygroundFromViewAction", + "when": "false" + }, + { + "command": "mdb.createNewPlaygroundFromOverviewPage", + "when": "false" + }, + { + "command": "mdb.createNewPlaygroundFromPlaygroundExplorer", + "when": "false" + }, + { + "command": "mdb.changeActiveConnection", + "when": "false" + }, + { + "command": "mdb.copyConnectionString", + "when": "false" + }, + { + "command": "mdb.renameConnection", + "when": "false" + }, + { + "command": "mdb.treeItemRemoveConnection", + "when": "false" + }, + { + "command": "mdb.addDatabase", + "when": "false" + }, + { + "command": "mdb.openPlaygroundFromTreeItem", + "when": "false" + }, + { + "command": "mdb.connectToConnectionTreeItem", + "when": "false" + }, + { + "command": "mdb.treeViewOpenMongoDBShell", + "when": "false" + }, + { + "command": "mdb.disconnectFromConnectionTreeItem", + "when": "false" + }, + { + "command": "mdb.refreshConnection", + "when": "false" + }, + { + "command": "mdb.copyDatabaseName", + "when": "false" + }, + { + "command": "mdb.dropDatabase", + "when": "false" + }, + { + "command": "mdb.refreshDatabase", + "when": "false" + }, + { + "command": "mdb.addCollection", + "when": "false" + }, + { + "command": "mdb.viewCollectionDocuments", + "when": "false" + }, + { + "command": "mdb.refreshDocumentList", + "when": "false" + }, + { + "command": "mdb.copyCollectionName", + "when": "false" + }, + { + "command": "mdb.dropCollection", + "when": "false" + }, + { + "command": "mdb.refreshCollection", + "when": "false" + }, + { + "command": "mdb.refreshSchema", + "when": "false" + }, + { + "command": "mdb.runPlayground", + "when": "false" + }, + { + "command": "mdb.createIndexFromTreeView", + "when": "false" + }, + { + "command": "mdb.refreshIndexes", + "when": "false" + }, + { + "command": "mdb.copySchemaFieldName", + "when": "false" + } + ] + }, + "keybindings": [ + { + "command": "mdb.runSelectedPlaygroundBlocks", + "key": "ctrl+alt+s", + "mac": "cmd+alt+s", + "when": "editorLangId == mongodb" + }, + { + "command": "mdb.runAllPlaygroundBlocks", + "key": "ctrl+alt+r", + "mac": "cmd+alt+r", + "when": "editorLangId == mongodb" + }, + { + "command": "mdb.saveMongoDBDocument", + "key": "ctrl+s", + "mac": "cmd+s", + "when": "editorLangId == json" + } + ], + "capabilities": { + "codeLensProvider": { + "resolveProvider": "true" + } + }, + "configuration": { + "title": "MongoDB", + "properties": { + "mongodbLanguageServer.maxNumberOfProblems": { + "scope": "resource", + "type": "number", + "default": 100, + "description": "Controls the maximum number of problems produced by the server." + }, + "mongodbLanguageServer.trace.server": { + "scope": "window", + "type": "object", + "properties": { + "verbosity": { + "type": "string", + "enum": [ + "off", + "messages", + "verbose" + ], + "default": "off", + "description": "Controls the verbosity of the trace." + }, + "format": { + "type": "string", + "enum": [ + "text", + "json" + ], + "default": "text", + "description": "Controls the output format of the trace." + } + } + }, + "mdb.shell": { + "type": "string", + "enum": [ + "mongosh", + "mongo" + ], + "enumDescriptions": [ + "Use the new mongosh", + "Use the legacy mongo shell" + ], + "default": "mongosh", + "description": "The MongoDB shell to use." + }, + "mdb.showMongoDBConnectionExplorer": { + "type": "boolean", + "default": true, + "description": "Show or hide the MongoDB connections view." + }, + "mdb.showMongoDBPlaygrounds": { + "type": "boolean", + "default": true, + "description": "Show or hide the MongoDB playgrounds view." + }, + "mdb.showMongoDBHelpExplorer": { + "type": "boolean", + "default": true, + "description": "Show or hide the help and feedback view." + }, + "mdb.excludeFromPlaygroundsSearch": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Files and folders to exclude while searching for playground in the the current workspace.", + "default": [ + "**/.*", + "**/_output/**", + "**/bower_components/**", + "**/build/**", + "**/dist/**", + "**/node_modules/**", + "**/out/**", + "**/output/**", + "**/release/**", + "**/releases/**", + "**/static/**", + "**/target/**", + "**/third_party/**", + "**/vendor/**" + ] + }, + "mdb.defaultLimit": { + "type": "number", + "default": 10, + "description": "The number of documents to fetch when viewing documents from a collection." + }, + "mdb.confirmRunAll": { + "type": "boolean", + "default": true, + "description": "Show a confirmation message before running commands in a playground." + }, + "mdb.sendTelemetry": { + "type": "boolean", + "default": true, + "description": "Allow the collection of anonynous diagnostic and usage telemetry data to help improve the product." + }, + "mdb.connectionSaving.hideOptionToChooseWhereToSaveNewConnections": { + "type": "boolean", + "default": true, + "description": "When a connection is added, a prompt is shown that let's the user decide where the new connection should be saved. When this setting is checked, the prompt is not shown and the default connection saving location setting is used." + }, + "mdb.connectionSaving.defaultConnectionSavingLocation": { + "type": "string", + "enum": [ + "Workspace", + "Global", + "Session Only" + ], + "enumDescriptions": [ + "Save new connections globally on vscode.", + "Save new connections to the active workspace.", + "Don't save new connections (connections are lost when the session is closed)." + ], + "default": "Global", + "description": "When the setting that hides the option to choose where to save new connections is checked, this setting sets if and where new connections are saved." + }, + "mdb.useDefaultTemplateForPlayground": { + "type": "boolean", + "default": true, + "description": "Use default template for playground files." + } + } + } + }, + "dependencies": { + "@babel/parser": "^7.15.0", + "@babel/traverse": "^7.15.0", + "@fortawesome/fontawesome-svg-core": "^1.2.36", + "@fortawesome/free-solid-svg-icons": "^5.15.4", + "@fortawesome/react-fontawesome": "^0.1.15", + "@iconify-icons/codicon": "^1.1.18", + "@iconify/react": "^1.1.4", + "@leafygreen-ui/toggle": "3.0.1", + "@mongosh/browser-runtime-electron": "^1.0.4", + "@mongosh/i18n": "^1.0.4", + "@mongosh/service-provider-server": "^1.0.4", + "@mongosh/shell-api": "^1.0.4", + "analytics-node": "^3.5.0", + "bson": "^4.4.1", + "classnames": "^2.3.1", + "debug": "^4.3.2", + "dotenv": "^8.2.0", + "micromatch": "^4.0.4", + "mongodb": "addaleax/node-mongodb-native#71d4c39e5c858f49d10e840df626eca4da653e28", + "mongodb-cloud-info": "^1.1.2", + "mongodb-connection-model": "^21.5.3", + "mongodb-data-service": "^21.5.3", + "mongodb-js-errors": "^0.5.0", + "mongodb-ns": "^2.2.0", + "mongodb-schema": "^9.0.0", + "numeral": "^2.0.6", + "react": "^16.13.1", + "react-dom": "^16.13.1", + "react-redux": "^7.2.4", + "redux": "^4.1.1", + "ts-log": "^2.2.3", + "uuid": "^8.3.2", + "vscode-languageclient": "^7.0.0", + "vscode-languageserver": "^7.0.0", + "vscode-languageserver-textdocument": "^1.0.1", + "ws": "^7.4.2" + }, + "devDependencies": { + "@types/analytics-node": "^3.1.5", + "@types/babel__core": "^7.1.15", + "@types/babel__traverse": "^7.14.2", + "@types/chai": "^4.2.21", + "@types/chai-fs": "^2.0.2", + "@types/chai-json-schema": "^1.4.6", + "@types/classnames": "^2.3.1", + "@types/debug": "^4.1.7", + "@types/enzyme": "^3.10.9", + "@types/glob": "^7.1.4", + "@types/jest": "^26.0.24", + "@types/mocha": "^8.2.0", + "@types/node": "^14.14.22", + "@types/react": "^17.0.15", + "@types/react-dom": "^17.0.9", + "@types/sinon": "^9.0.10", + "@types/uuid": "^8.3.1", + "@types/vscode": "^1.58.1", + "@types/ws": "^7.4.7", + "@typescript-eslint/eslint-plugin": "^4.29.0", + "@typescript-eslint/parser": "^4.29.0", + "autoprefixer": "^9.7.5", + "chai": "^4.3.4", + "chai-as-promised": "^7.1.1", + "chai-fs": "^2.0.0", + "chai-json-schema": "^1.5.1", + "chalk": "^4.1.2", + "cli-ux": "^5.6.3", + "cross-env": "^7.0.3", + "css-loader": "^3.4.2", + "depcheck": "^1.4.2", + "download": "^8.0.0", + "enzyme": "^3.11.0", + "enzyme-adapter-react-16": "^1.15.6", + "eslint": "^6.8.0", + "eslint-config-mongodb-js": "^5.0.3", + "eslint-plugin-mocha": "^8.0.0", + "execa": "^1.0.0", + "glob": "^7.1.7", + "jest": "^26.5.2", + "jest-junit": "^12.2.0", + "jest-transform-stub": "^2.0.0", + "less": "^3.13.1", + "less-loader": "^5.0.0", + "meow": "^9.0.0", + "mkdirp": "^1.0.4", + "mocha": "^8.2.1", + "mocha-junit-reporter": "^2.0.0", + "mocha-multi": "^1.1.3", + "mongodb-ace-autocompleter": "^0.6.0", + "mongodb-build-info": "^1.2.0", + "mongodb-runner": "^4.8.3", + "node-loader": "^0.6.0", + "npm-run-all": "^4.1.5", + "ora": "^5.4.1", + "postcss-loader": "^3.0.0", + "pre-commit": "^1.2.2", + "semver": "^7.3.5", + "sinon": "^9.2.4", + "sinon-chai": "^3.7.0", + "style-loader": "^1.1.3", + "ts-jest": "^26.5.0", + "ts-loader": "^8.0.14", + "ts-node": "^9.1.1", + "typescript": "^4.3.5", + "vsce": "^1.96.1", + "vscode-test": "^1.6.1", + "webpack": "^4.46.0", + "webpack-cli": "^3.3.11", + "xvfb-maybe": "^0.2.1", + "yargs-parser": "^20.2.9" + }, + "precommit": [ + "check" + ] +} \ No newline at end of file diff --git a/tests/licensedcode/data/plugin_license/license_reference/scan/scan-without-ref/license-notice.txt b/tests/licensedcode/data/plugin_license/license_reference/scan/scan-without-ref/license-notice.txt new file mode 100644 index 00000000000..3e4a9a96e69 --- /dev/null +++ b/tests/licensedcode/data/plugin_license/license_reference/scan/scan-without-ref/license-notice.txt @@ -0,0 +1,977 @@ +{ + "preview": true, + "name": "mongodb-vscode", + "displayName": "MongoDB for VS Code", + "description": "Connect to MongoDB and Atlas directly from your VS Code environment, navigate your databases and collections, inspect your schema and use playgrounds to prototype queries and aggregations.", + "version": "0.0.0-dev.0", + "homepage": "https://github.com/mongodb-js/vscode", + "qna": "https://developer.mongodb.com/community/forums/", + "repository": { + "type": "git", + "url": "https://github.com/mongodb-js/vscode" + }, + "bugs": { + "url": "https://github.com/mongodb-js/vscode/issues", + "email": "vscode@mongodb.com" + }, + "publisher": "mongodb", + "categories": [ + "Programming Languages", + "Snippets", + "Other" + ], + "keywords": [ + "MongoDB", + "MongoDB Atlas", + "MQL", + "Databases" + ], + "icon": "images/mongodb.png", + "galleryBanner": { + "color": "#3D4F58", + "theme": "dark" + }, + "license": "SEE LICENSE IN LICENSE.txt", + "main": "./dist/extension.js", + "scripts": { + "clean": "rimraf ./out/* ./dist/* ", + "lint": "eslint --cache '**/*.{js,ts,tsx}'", + "update-grammar": "ts-node ./scripts/update-grammar.ts", + "update-snippets": "ts-node ./scripts/update-snippets.ts", + "precompile": "npm run clean", + "compile": "npm-run-all compile:*", + "compile:keyfile": "ts-node ./scripts/generate-keyfile.ts", + "compile:resources": "npm run update-grammar && npm run update-snippets", + "compile:extension": "tsc -p ./", + "compile:extension-bundles": "webpack --mode development", + "watch": "npm run compile && npm-run-all -p watch:*", + "watch:extension": "npm run compile:extension -- -watch", + "watch:extension-bundles": "webpack --mode development --info-verbosity verbose --watch", + "pretest": "npm run compile && cross-env MONGODB_VERSION=4.2.3 mongodb-runner start --port=27018", + "test": "npm run test-webview && npm run test-extension", + "test-extension": "cross-env NODE_OPTIONS=--no-force-async-hooks-checks xvfb-maybe node ./out/test/runTest.js", + "test-webview": "jest", + "posttest": "mongodb-runner stop --port=27018", + "vscode:prepublish": "npm run clean && npm run compile:keyfile && npm run compile:resources && webpack --mode production", + "check": "npm run lint && npm run check-dependencies", + "check-dependencies": "depcheck --ignores='vscode,keytar,@types/jest,mocha-junit-reporter,mocha-multi,pre-commit,webpack-cli,vscode-languageserver-textdocument,@babel/core'", + "package": "npm list --production --parseable --depth=99999 --loglevel=info || true && cross-env NODE_OPTIONS=\"--require ./scripts/no-npm-list-fail.js\" vsce package --githubBranch main", + "local-install": "npm run package && code --install-extension ./mongodb-vscode-*.vsix", + "check-vsix-size": "ts-node ./scripts/check-vsix-size.ts", + "release-draft": "node ./scripts/release-draft.js" + }, + "engines": { + "vscode": "^1.58.1", + "node": "^14.17.3", + "npm": "^7.19.0" + }, + "activationEvents": [ + "onCommand:mdb.connect", + "onCommand:mdb.connectWithURI", + "onCommand:mdb.openOverviewPage", + "onCommand:mdb.createPlayground", + "onCommand:mdb.addConnection", + "onCommand:mdb.addConnectionWithURI", + "onCommand:mdb.disconnect", + "onCommand:mdb.removeConnection", + "onCommand:mdb.openMongoDBShell", + "onCommand:mdb.saveMongoDBDocument", + "onView:mongoDB", + "onView:mongoDBConnectionExplorer", + "onView:mongoDBPlaygroundsExplorer", + "onLanguage:json", + "onLanguage:mongodb" + ], + "contributes": { + "viewsContainers": { + "activitybar": [ + { + "id": "mongoDB", + "title": "MongoDB", + "icon": "images/sidebar-leaf.svg" + } + ] + }, + "views": { + "mongoDB": [ + { + "id": "mongoDBConnectionExplorer", + "name": "Connections", + "when": "config.mdb.showMongoDBConnectionExplorer == true" + }, + { + "id": "mongoDBPlaygroundsExplorer", + "name": "Playgrounds", + "when": "config.mdb.showMongoDBPlaygrounds == true" + }, + { + "id": "mongoDBHelpExplorer", + "name": "Help and Feedback", + "when": "config.mdb.showMongoDBHelpExplorer == true" + } + ] + }, + "viewsWelcome": [ + { + "view": "mongoDBConnectionExplorer", + "contents": "No connections found.\n[Add Connection](command:mdb.connect)" + }, + { + "view": "mongoDBPlaygroundsExplorer", + "contents": "No '.mongodb' playground files found in the workspace.\n[Create New Playground](command:mdb.createNewPlaygroundFromPlaygroundExplorer)" + } + ], + "languages": [ + { + "id": "mongodb", + "aliases": [ + "MongoDB", + "mongodb" + ], + "extensions": [ + ".mongodb" + ], + "configuration": "./languages/mongodb-language-configuration.json" + }, + { + "id": "terraform", + "aliases": [ + "Terraform", + "terraform" + ], + "extensions": [ + ".tf" + ] + } + ], + "grammars": [ + { + "language": "mongodb", + "path": "./syntaxes/mongodb.tmLanguage.json", + "scopeName": "source.mongodb" + } + ], + "snippets": [ + { + "language": "mongodb", + "path": "./snippets/stage-autocompleter.json" + }, + { + "language": "terraform", + "path": "./snippets/atlas-terraform.json" + } + ], + "commands": [ + { + "command": "mdb.connect", + "title": "MongoDB: Connect" + }, + { + "command": "mdb.connectWithURI", + "title": "MongoDB: Connect with Connection String..." + }, + { + "command": "mdb.disconnect", + "title": "MongoDB: Disconnect" + }, + { + "command": "mdb.removeConnection", + "title": "MongoDB: Remove Connection..." + }, + { + "command": "mdb.openOverviewPage", + "title": "MongoDB: Open Overview Page" + }, + { + "command": "mdb.openMongoDBShell", + "title": "MongoDB: Launch MongoDB Shell" + }, + { + "command": "mdb.treeViewOpenMongoDBShell", + "title": "Launch MongoDB Shell" + }, + { + "command": "mdb.createPlayground", + "title": "MongoDB: Create MongoDB Playground" + }, + { + "command": "mdb.refreshPlaygrounds", + "title": "MongoDB: Refresh Playgrounds List" + }, + { + "command": "mdb.refreshPlaygroundsFromTreeView", + "title": "Refresh", + "icon": { + "light": "images/light/refresh.svg", + "dark": "images/dark/refresh.svg" + } + }, + { + "command": "mdb.createNewPlaygroundFromViewAction", + "title": "Create MongoDB Playground" + }, + { + "command": "mdb.createNewPlaygroundFromOverviewPage", + "title": "Create MongoDB Playground" + }, + { + "command": "mdb.createNewPlaygroundFromPlaygroundExplorer", + "title": "Create MongoDB Playground", + "icon": { + "light": "images/light/add.svg", + "dark": "images/dark/add.svg" + } + }, + { + "command": "mdb.changeActiveConnection", + "title": "MongoDB: Change Active Connection" + }, + { + "command": "mdb.runSelectedPlaygroundBlocks", + "title": "MongoDB: Run Selected Lines From Playground" + }, + { + "command": "mdb.saveMongoDBDocument", + "title": "MongoDB: Save Document To MongoDB" + }, + { + "command": "mdb.runAllPlaygroundBlocks", + "title": "MongoDB: Run All From Playground" + }, + { + "command": "mdb.runPlayground", + "title": "MongoDB: Run All or Selection From Playground", + "icon": { + "light": "images/light/play.svg", + "dark": "images/dark/play.svg" + } + }, + { + "command": "mdb.addConnection", + "title": "Add MongoDB Connection", + "icon": { + "light": "images/light/add.svg", + "dark": "images/dark/add.svg" + } + }, + { + "command": "mdb.addConnectionWithURI", + "title": "Add MongoDB Connection with Connection String...", + "icon": { + "light": "images/light/add.svg", + "dark": "images/dark/add.svg" + } + }, + { + "command": "mdb.copyConnectionString", + "title": "Copy Connection String" + }, + { + "command": "mdb.renameConnection", + "title": "Rename Connection..." + }, + { + "command": "mdb.treeItemRemoveConnection", + "title": "Remove Connection..." + }, + { + "command": "mdb.addDatabase", + "title": "Add Database...", + "icon": { + "light": "images/light/plus-circle.svg", + "dark": "images/dark/plus-circle.svg" + } + }, + { + "command": "mdb.searchForDocuments", + "title": "Search For Documents...", + "icon": { + "light": "images/light/search-regular.svg", + "dark": "images/dark/search-regular.svg" + } + }, + { + "command": "mdb.openPlaygroundFromTreeItem", + "title": "Open Playground" + }, + { + "command": "mdb.connectToConnectionTreeItem", + "title": "Connect" + }, + { + "command": "mdb.disconnectFromConnectionTreeItem", + "title": "Disconnect" + }, + { + "command": "mdb.refreshConnection", + "title": "Refresh" + }, + { + "command": "mdb.copyDatabaseName", + "title": "Copy Database Name" + }, + { + "command": "mdb.dropDatabase", + "title": "Drop Database..." + }, + { + "command": "mdb.refreshDatabase", + "title": "Refresh" + }, + { + "command": "mdb.addCollection", + "title": "Add Collection...", + "icon": { + "light": "images/light/plus-circle.svg", + "dark": "images/dark/plus-circle.svg" + } + }, + { + "command": "mdb.viewCollectionDocuments", + "title": "View Documents" + }, + { + "command": "mdb.refreshDocumentList", + "title": "Refresh", + "icon": { + "light": "images/light/refresh.svg", + "dark": "images/dark/refresh.svg" + } + }, + { + "command": "mdb.copyCollectionName", + "title": "Copy Collection Name" + }, + { + "command": "mdb.dropCollection", + "title": "Drop Collection..." + }, + { + "command": "mdb.refreshCollection", + "title": "Refresh" + }, + { + "command": "mdb.refreshSchema", + "title": "Refresh" + }, + { + "command": "mdb.copySchemaFieldName", + "title": "Copy Field Name" + }, + { + "command": "mdb.refreshIndexes", + "title": "Refresh" + }, + { + "command": "mdb.createIndexFromTreeView", + "title": "Create New Index...", + "icon": { + "light": "images/light/plus-circle.svg", + "dark": "images/dark/plus-circle.svg" + } + }, + { + "command": "mdb.startStreamLanguageServerLogs", + "title": "LSP Inspector: Start Stream LSP Logs" + } + ], + "menus": { + "view/title": [ + { + "command": "mdb.createNewPlaygroundFromViewAction", + "when": "view == mongoDBPlaygroundsExplorer" + }, + { + "command": "mdb.createNewPlaygroundFromPlaygroundExplorer", + "when": "view == mongoDBPlaygroundsExplorer", + "group": "navigation@1" + }, + { + "command": "mdb.refreshPlaygroundsFromTreeView", + "when": "view == mongoDBPlaygroundsExplorer", + "group": "navigation@5" + }, + { + "command": "mdb.addConnection", + "when": "view == mongoDBConnectionExplorer", + "group": "navigation@1" + }, + { + "command": "mdb.addConnection", + "when": "view == mongoDBConnectionExplorer" + }, + { + "command": "mdb.addConnectionWithURI", + "when": "view == mongoDBConnectionExplorer" + } + ], + "view/item/context": [ + { + "command": "mdb.addDatabase", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "inline" + }, + { + "command": "mdb.addDatabase", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "1@1" + }, + { + "command": "mdb.refreshConnection", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "1@2" + }, + { + "command": "mdb.treeViewOpenMongoDBShell", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "2@1" + }, + { + "command": "mdb.renameConnection", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "3@1" + }, + { + "command": "mdb.copyConnectionString", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "4@1" + }, + { + "command": "mdb.disconnectFromConnectionTreeItem", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "5@1" + }, + { + "command": "mdb.treeItemRemoveConnection", + "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", + "group": "5@2" + }, + { + "command": "mdb.openPlaygroundFromTreeItem", + "when": "view == mongoDBPlaygroundsExplorer && viewItem == playgroundsTreeItem", + "group": "1@1" + }, + { + "command": "mdb.connectToConnectionTreeItem", + "when": "view == mongoDBConnectionExplorer && viewItem == disconnectedConnectionTreeItem", + "group": "1@1" + }, + { + "command": "mdb.renameConnection", + "when": "view == mongoDBConnectionExplorer && viewItem == disconnectedConnectionTreeItem", + "group": "2@1" + }, + { + "command": "mdb.copyConnectionString", + "when": "view == mongoDBConnectionExplorer && viewItem == disconnectedConnectionTreeItem", + "group": "3@1" + }, + { + "command": "mdb.treeItemRemoveConnection", + "when": "view == mongoDBConnectionExplorer && viewItem == disconnectedConnectionTreeItem", + "group": "4@1" + }, + { + "command": "mdb.addCollection", + "when": "view == mongoDBConnectionExplorer && viewItem == databaseTreeItem", + "group": "inline" + }, + { + "command": "mdb.addCollection", + "when": "view == mongoDBConnectionExplorer && viewItem == databaseTreeItem", + "group": "1@1" + }, + { + "command": "mdb.refreshDatabase", + "when": "view == mongoDBConnectionExplorer && viewItem == databaseTreeItem", + "group": "1@2" + }, + { + "command": "mdb.copyDatabaseName", + "when": "view == mongoDBConnectionExplorer && viewItem == databaseTreeItem", + "group": "2@1" + }, + { + "command": "mdb.dropDatabase", + "when": "view == mongoDBConnectionExplorer && viewItem == databaseTreeItem", + "group": "3@1" + }, + { + "command": "mdb.viewCollectionDocuments", + "when": "view == mongoDBConnectionExplorer && viewItem == collectionTreeItem", + "group": "1@1" + }, + { + "command": "mdb.refreshCollection", + "when": "view == mongoDBConnectionExplorer && viewItem == collectionTreeItem", + "group": "1@2" + }, + { + "command": "mdb.copyCollectionName", + "when": "view == mongoDBConnectionExplorer && viewItem == collectionTreeItem", + "group": "2@1" + }, + { + "command": "mdb.dropCollection", + "when": "view == mongoDBConnectionExplorer && viewItem == collectionTreeItem", + "group": "3@1" + }, + { + "command": "mdb.searchForDocuments", + "when": "view == mongoDBConnectionExplorer && viewItem == documentListTreeItem", + "group": "inline" + }, + { + "command": "mdb.refreshDocumentList", + "when": "view == mongoDBConnectionExplorer && viewItem == documentListTreeItem", + "group": "inline" + }, + { + "command": "mdb.viewCollectionDocuments", + "when": "view == mongoDBConnectionExplorer && viewItem == documentListTreeItem" + }, + { + "command": "mdb.refreshDocumentList", + "when": "view == mongoDBConnectionExplorer && viewItem == documentListTreeItem" + }, + { + "command": "mdb.searchForDocuments", + "when": "view == mongoDBConnectionExplorer && viewItem == documentListTreeItem", + "group": "2@1" + }, + { + "command": "mdb.refreshSchema", + "when": "view == mongoDBConnectionExplorer && viewItem == schemaTreeItem" + }, + { + "command": "mdb.copySchemaFieldName", + "when": "view == mongoDBConnectionExplorer && viewItem == fieldTreeItem" + }, + { + "command": "mdb.createIndexFromTreeView", + "when": "view == mongoDBConnectionExplorer && viewItem == indexListTreeItem", + "group": "inline" + }, + { + "command": "mdb.refreshIndexes", + "when": "view == mongoDBConnectionExplorer && viewItem == indexListTreeItem" + }, + { + "command": "mdb.createIndexFromTreeView", + "when": "view == mongoDBConnectionExplorer && viewItem == indexListTreeItem" + } + ], + "editor/title": [ + { + "command": "mdb.runPlayground", + "group": "navigation", + "when": "editorLangId == mongodb" + } + ], + "commandPalette": [ + { + "command": "mdb.saveMongoDBDocument", + "when": "editorLangId == json" + }, + { + "command": "mdb.runSelectedPlaygroundBlocks", + "when": "editorLangId == mongodb" + }, + { + "command": "mdb.runAllPlaygroundBlocks", + "when": "editorLangId == mongodb" + }, + { + "command": "mdb.refreshPlaygroundsFromTreeView", + "when": "false" + }, + { + "command": "mdb.searchForDocuments", + "when": "false" + }, + { + "command": "mdb.addConnection", + "when": "false" + }, + { + "command": "mdb.addConnectionWithURI", + "when": "false" + }, + { + "command": "mdb.createNewPlaygroundFromViewAction", + "when": "false" + }, + { + "command": "mdb.createNewPlaygroundFromOverviewPage", + "when": "false" + }, + { + "command": "mdb.createNewPlaygroundFromPlaygroundExplorer", + "when": "false" + }, + { + "command": "mdb.changeActiveConnection", + "when": "false" + }, + { + "command": "mdb.copyConnectionString", + "when": "false" + }, + { + "command": "mdb.renameConnection", + "when": "false" + }, + { + "command": "mdb.treeItemRemoveConnection", + "when": "false" + }, + { + "command": "mdb.addDatabase", + "when": "false" + }, + { + "command": "mdb.openPlaygroundFromTreeItem", + "when": "false" + }, + { + "command": "mdb.connectToConnectionTreeItem", + "when": "false" + }, + { + "command": "mdb.treeViewOpenMongoDBShell", + "when": "false" + }, + { + "command": "mdb.disconnectFromConnectionTreeItem", + "when": "false" + }, + { + "command": "mdb.refreshConnection", + "when": "false" + }, + { + "command": "mdb.copyDatabaseName", + "when": "false" + }, + { + "command": "mdb.dropDatabase", + "when": "false" + }, + { + "command": "mdb.refreshDatabase", + "when": "false" + }, + { + "command": "mdb.addCollection", + "when": "false" + }, + { + "command": "mdb.viewCollectionDocuments", + "when": "false" + }, + { + "command": "mdb.refreshDocumentList", + "when": "false" + }, + { + "command": "mdb.copyCollectionName", + "when": "false" + }, + { + "command": "mdb.dropCollection", + "when": "false" + }, + { + "command": "mdb.refreshCollection", + "when": "false" + }, + { + "command": "mdb.refreshSchema", + "when": "false" + }, + { + "command": "mdb.runPlayground", + "when": "false" + }, + { + "command": "mdb.createIndexFromTreeView", + "when": "false" + }, + { + "command": "mdb.refreshIndexes", + "when": "false" + }, + { + "command": "mdb.copySchemaFieldName", + "when": "false" + } + ] + }, + "keybindings": [ + { + "command": "mdb.runSelectedPlaygroundBlocks", + "key": "ctrl+alt+s", + "mac": "cmd+alt+s", + "when": "editorLangId == mongodb" + }, + { + "command": "mdb.runAllPlaygroundBlocks", + "key": "ctrl+alt+r", + "mac": "cmd+alt+r", + "when": "editorLangId == mongodb" + }, + { + "command": "mdb.saveMongoDBDocument", + "key": "ctrl+s", + "mac": "cmd+s", + "when": "editorLangId == json" + } + ], + "capabilities": { + "codeLensProvider": { + "resolveProvider": "true" + } + }, + "configuration": { + "title": "MongoDB", + "properties": { + "mongodbLanguageServer.maxNumberOfProblems": { + "scope": "resource", + "type": "number", + "default": 100, + "description": "Controls the maximum number of problems produced by the server." + }, + "mongodbLanguageServer.trace.server": { + "scope": "window", + "type": "object", + "properties": { + "verbosity": { + "type": "string", + "enum": [ + "off", + "messages", + "verbose" + ], + "default": "off", + "description": "Controls the verbosity of the trace." + }, + "format": { + "type": "string", + "enum": [ + "text", + "json" + ], + "default": "text", + "description": "Controls the output format of the trace." + } + } + }, + "mdb.shell": { + "type": "string", + "enum": [ + "mongosh", + "mongo" + ], + "enumDescriptions": [ + "Use the new mongosh", + "Use the legacy mongo shell" + ], + "default": "mongosh", + "description": "The MongoDB shell to use." + }, + "mdb.showMongoDBConnectionExplorer": { + "type": "boolean", + "default": true, + "description": "Show or hide the MongoDB connections view." + }, + "mdb.showMongoDBPlaygrounds": { + "type": "boolean", + "default": true, + "description": "Show or hide the MongoDB playgrounds view." + }, + "mdb.showMongoDBHelpExplorer": { + "type": "boolean", + "default": true, + "description": "Show or hide the help and feedback view." + }, + "mdb.excludeFromPlaygroundsSearch": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Files and folders to exclude while searching for playground in the the current workspace.", + "default": [ + "**/.*", + "**/_output/**", + "**/bower_components/**", + "**/build/**", + "**/dist/**", + "**/node_modules/**", + "**/out/**", + "**/output/**", + "**/release/**", + "**/releases/**", + "**/static/**", + "**/target/**", + "**/third_party/**", + "**/vendor/**" + ] + }, + "mdb.defaultLimit": { + "type": "number", + "default": 10, + "description": "The number of documents to fetch when viewing documents from a collection." + }, + "mdb.confirmRunAll": { + "type": "boolean", + "default": true, + "description": "Show a confirmation message before running commands in a playground." + }, + "mdb.sendTelemetry": { + "type": "boolean", + "default": true, + "description": "Allow the collection of anonynous diagnostic and usage telemetry data to help improve the product." + }, + "mdb.connectionSaving.hideOptionToChooseWhereToSaveNewConnections": { + "type": "boolean", + "default": true, + "description": "When a connection is added, a prompt is shown that let's the user decide where the new connection should be saved. When this setting is checked, the prompt is not shown and the default connection saving location setting is used." + }, + "mdb.connectionSaving.defaultConnectionSavingLocation": { + "type": "string", + "enum": [ + "Workspace", + "Global", + "Session Only" + ], + "enumDescriptions": [ + "Save new connections globally on vscode.", + "Save new connections to the active workspace.", + "Don't save new connections (connections are lost when the session is closed)." + ], + "default": "Global", + "description": "When the setting that hides the option to choose where to save new connections is checked, this setting sets if and where new connections are saved." + }, + "mdb.useDefaultTemplateForPlayground": { + "type": "boolean", + "default": true, + "description": "Use default template for playground files." + } + } + } + }, + "dependencies": { + "@babel/parser": "^7.15.0", + "@babel/traverse": "^7.15.0", + "@fortawesome/fontawesome-svg-core": "^1.2.36", + "@fortawesome/free-solid-svg-icons": "^5.15.4", + "@fortawesome/react-fontawesome": "^0.1.15", + "@iconify-icons/codicon": "^1.1.18", + "@iconify/react": "^1.1.4", + "@leafygreen-ui/toggle": "3.0.1", + "@mongosh/browser-runtime-electron": "^1.0.4", + "@mongosh/i18n": "^1.0.4", + "@mongosh/service-provider-server": "^1.0.4", + "@mongosh/shell-api": "^1.0.4", + "analytics-node": "^3.5.0", + "bson": "^4.4.1", + "classnames": "^2.3.1", + "debug": "^4.3.2", + "dotenv": "^8.2.0", + "micromatch": "^4.0.4", + "mongodb": "addaleax/node-mongodb-native#71d4c39e5c858f49d10e840df626eca4da653e28", + "mongodb-cloud-info": "^1.1.2", + "mongodb-connection-model": "^21.5.3", + "mongodb-data-service": "^21.5.3", + "mongodb-js-errors": "^0.5.0", + "mongodb-ns": "^2.2.0", + "mongodb-schema": "^9.0.0", + "numeral": "^2.0.6", + "react": "^16.13.1", + "react-dom": "^16.13.1", + "react-redux": "^7.2.4", + "redux": "^4.1.1", + "ts-log": "^2.2.3", + "uuid": "^8.3.2", + "vscode-languageclient": "^7.0.0", + "vscode-languageserver": "^7.0.0", + "vscode-languageserver-textdocument": "^1.0.1", + "ws": "^7.4.2" + }, + "devDependencies": { + "@types/analytics-node": "^3.1.5", + "@types/babel__core": "^7.1.15", + "@types/babel__traverse": "^7.14.2", + "@types/chai": "^4.2.21", + "@types/chai-fs": "^2.0.2", + "@types/chai-json-schema": "^1.4.6", + "@types/classnames": "^2.3.1", + "@types/debug": "^4.1.7", + "@types/enzyme": "^3.10.9", + "@types/glob": "^7.1.4", + "@types/jest": "^26.0.24", + "@types/mocha": "^8.2.0", + "@types/node": "^14.14.22", + "@types/react": "^17.0.15", + "@types/react-dom": "^17.0.9", + "@types/sinon": "^9.0.10", + "@types/uuid": "^8.3.1", + "@types/vscode": "^1.58.1", + "@types/ws": "^7.4.7", + "@typescript-eslint/eslint-plugin": "^4.29.0", + "@typescript-eslint/parser": "^4.29.0", + "autoprefixer": "^9.7.5", + "chai": "^4.3.4", + "chai-as-promised": "^7.1.1", + "chai-fs": "^2.0.0", + "chai-json-schema": "^1.5.1", + "chalk": "^4.1.2", + "cli-ux": "^5.6.3", + "cross-env": "^7.0.3", + "css-loader": "^3.4.2", + "depcheck": "^1.4.2", + "download": "^8.0.0", + "enzyme": "^3.11.0", + "enzyme-adapter-react-16": "^1.15.6", + "eslint": "^6.8.0", + "eslint-config-mongodb-js": "^5.0.3", + "eslint-plugin-mocha": "^8.0.0", + "execa": "^1.0.0", + "glob": "^7.1.7", + "jest": "^26.5.2", + "jest-junit": "^12.2.0", + "jest-transform-stub": "^2.0.0", + "less": "^3.13.1", + "less-loader": "^5.0.0", + "meow": "^9.0.0", + "mkdirp": "^1.0.4", + "mocha": "^8.2.1", + "mocha-junit-reporter": "^2.0.0", + "mocha-multi": "^1.1.3", + "mongodb-ace-autocompleter": "^0.6.0", + "mongodb-build-info": "^1.2.0", + "mongodb-runner": "^4.8.3", + "node-loader": "^0.6.0", + "npm-run-all": "^4.1.5", + "ora": "^5.4.1", + "postcss-loader": "^3.0.0", + "pre-commit": "^1.2.2", + "semver": "^7.3.5", + "sinon": "^9.2.4", + "sinon-chai": "^3.7.0", + "style-loader": "^1.1.3", + "ts-jest": "^26.5.0", + "ts-loader": "^8.0.14", + "ts-node": "^9.1.1", + "typescript": "^4.3.5", + "vsce": "^1.96.1", + "vscode-test": "^1.6.1", + "webpack": "^4.46.0", + "webpack-cli": "^3.3.11", + "xvfb-maybe": "^0.2.1", + "yargs-parser": "^20.2.9" + }, + "precommit": [ + "check" + ] +} \ No newline at end of file diff --git a/tests/licensedcode/test_plugin_license.py b/tests/licensedcode/test_plugin_license.py index 53dbf37cee0..56fdea9c74f 100644 --- a/tests/licensedcode/test_plugin_license.py +++ b/tests/licensedcode/test_plugin_license.py @@ -9,6 +9,10 @@ import os +from click.testing import Result +from licensedcode.plugin_license import find_referenced_resource, match_reference_license +from licensedcode.plugin_license import get_referenced_filenames + import pytest from commoncode.testcase import FileDrivenTesting @@ -68,6 +72,66 @@ def test_license_option_reports_license_texts_diag_long_lines(): check_json_scan(test_loc, result_file, regen=False) +def test_license_match_reference(): + test_dir = test_env.get_test_loc('plugin_license/license_reference/scan/scan-ref', copy=True) + result_file = test_env.get_temp_file('json') + args = ['--license', '--license-text', '--license-text-diagnostics', '--strip-root', test_dir, '--json', result_file, '--verbose'] + run_scan_click(args) + test_loc = test_env.get_test_loc('plugin_license/license_reference/scan-ref.expected.json') + check_json_scan(test_loc, result_file, regen=False) + + +def test_license_match_without_reference(): + test_dir = test_env.get_test_loc('plugin_license/license_reference/scan/scan-without-ref', copy=True) + result_file = test_env.get_temp_file('json') + args = ['--license', '--license-text', '--license-text-diagnostics', '--strip-root', test_dir, '--json', result_file, '--verbose'] + run_scan_click(args) + test_loc = test_env.get_test_loc('plugin_license/license_reference/scan-wref.expected.json') + check_json_scan(test_loc, result_file, regen=False) + + +def test_get_referenced_filenames(): + license_matches = [ + {'matched_rule': {'referenced_filenames' : ['LICENSE.txt','COPYING']}}, + {'matched_rule': {'referenced_filenames' : ['COPYING','LICENSE.txt']}}, + {'matched_rule': {'referenced_filenames' : ['copying']}}, + {'matched_rule': {'referenced_filenames' : []}}, + ] + expected = ['LICENSE.txt','COPYING','copying'] + assert get_referenced_filenames(license_matches) == expected + + +def test_find_referenced_resource(): + # Setup: Create a new scan to use for a virtual codebase + test_dir = test_env.get_test_loc('plugin_license/license_reference/scan/scan-ref', copy=True) + scan_loc = test_env.get_temp_file('json') + args = ['--license', '--license-text', '--license-text-diagnostics', test_dir, '--json', scan_loc] + run_scan_click(args) + + # test proper + from commoncode.resource import VirtualCodebase + codebase = VirtualCodebase(scan_loc) + resource = codebase.get_resource_from_path('scan-ref/license-notice.txt') + result = find_referenced_resource(referenced_filename='LICENSE',resource=resource, codebase=codebase) + assert result.path == 'scan-ref/LICENSE' + + +def test_match_reference_license(): + # Setup: Create a new scan to use for a virtual codebase + test_dir = test_env.get_test_loc('plugin_license/license_reference/scan/scan-ref', copy=True) + scan_loc = test_env.get_temp_file('json') + args = ['--license', '--license-text', '--license-text-diagnostics', test_dir, '--json', scan_loc] + run_scan_click(args) + + # test proper + from commoncode.resource import VirtualCodebase + codebase = VirtualCodebase(scan_loc) + resource = codebase.get_resource_from_path('scan-ref/license-notice.txt') + assert len(resource.licenses) == 2 + result = match_reference_license(resource=resource, codebase=codebase) + assert len(result.licenses) == 3 + + def test_reindex_licenses_works(): args = ['--reindex-licenses'] run_scan_click(args) diff --git a/tests/summarycode/data/full_summary/summary.expected.json b/tests/summarycode/data/full_summary/summary.expected.json index 2c2b88b4c05..0e08432def1 100644 --- a/tests/summarycode/data/full_summary/summary.expected.json +++ b/tests/summarycode/data/full_summary/summary.expected.json @@ -23,7 +23,7 @@ "license_expressions": [ { "value": "zlib", - "count": 12 + "count": 19 }, { "value": null, @@ -3717,9 +3717,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 42.86, @@ -3887,9 +3926,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } - } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 + } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 20.34, @@ -7154,9 +7232,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 42.86, @@ -7240,9 +7357,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 40.0, @@ -7326,9 +7482,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 50.0, @@ -8095,9 +8290,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 37.5, @@ -8181,9 +8415,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 20.34, diff --git a/tests/summarycode/data/full_summary/summary_by_facet.expected.json b/tests/summarycode/data/full_summary/summary_by_facet.expected.json index 34b879c5200..205e9d914a8 100644 --- a/tests/summarycode/data/full_summary/summary_by_facet.expected.json +++ b/tests/summarycode/data/full_summary/summary_by_facet.expected.json @@ -31,7 +31,7 @@ "license_expressions": [ { "value": "zlib", - "count": 12 + "count": 19 }, { "value": null, @@ -218,7 +218,7 @@ "license_expressions": [ { "value": "zlib", - "count": 9 + "count": 16 }, { "value": "artistic-2.0", @@ -1214,9 +1214,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } - } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 + } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 42.86, @@ -1388,9 +1427,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } - } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 + } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 20.34, @@ -1818,9 +1896,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } - } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 + } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 42.86, @@ -1906,9 +2023,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } - } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 + } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 40.0, @@ -1994,9 +2150,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } - } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 + } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 50.0, @@ -2779,9 +2974,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } - } - ], + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 + } + } + ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 37.5, @@ -2867,9 +3101,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 20.34, diff --git a/tests/summarycode/data/full_summary/summary_details.expected.json b/tests/summarycode/data/full_summary/summary_details.expected.json index 18719c054be..89cb3fa5289 100644 --- a/tests/summarycode/data/full_summary/summary_details.expected.json +++ b/tests/summarycode/data/full_summary/summary_details.expected.json @@ -23,7 +23,7 @@ "license_expressions": [ { "value": "zlib", - "count": 12 + "count": 19 }, { "value": null, @@ -234,7 +234,7 @@ "license_expressions": [ { "value": "zlib", - "count": 12 + "count": 19 }, { "value": null, @@ -1403,7 +1403,7 @@ "license_expressions": [ { "value": "zlib", - "count": 3 + "count": 5 } ], "copyrights": [ @@ -1511,9 +1511,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 42.86, @@ -1537,7 +1576,7 @@ "license_expressions": [ { "value": "zlib", - "count": 1 + "count": 2 } ], "copyrights": [ @@ -1745,9 +1784,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 20.34, @@ -1771,7 +1849,7 @@ "license_expressions": [ { "value": "zlib", - "count": 1 + "count": 2 } ], "copyrights": [ @@ -4893,7 +4971,7 @@ "license_expressions": [ { "value": "zlib", - "count": 9 + "count": 14 }, { "value": null, @@ -5288,9 +5366,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown":false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 42.86, @@ -5314,7 +5431,7 @@ "license_expressions": [ { "value": "zlib", - "count": 1 + "count": 2 } ], "copyrights": [ @@ -5406,9 +5523,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown":false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 40.0, @@ -5432,7 +5588,7 @@ "license_expressions": [ { "value": "zlib", - "count": 1 + "count": 2 } ], "copyrights": [ @@ -5524,9 +5680,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown":false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 50.0, @@ -5550,7 +5745,7 @@ "license_expressions": [ { "value": "zlib", - "count": 1 + "count": 2 } ], "copyrights": [ @@ -6685,9 +6880,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 37.5, @@ -6711,7 +6945,7 @@ "license_expressions": [ { "value": "zlib", - "count": 1 + "count": 2 } ], "copyrights": [ @@ -6803,9 +7037,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 20.34, @@ -6829,7 +7102,7 @@ "license_expressions": [ { "value": "zlib", - "count": 1 + "count": 2 } ], "copyrights": [ diff --git a/tests/summarycode/data/full_summary/summary_key_files-details.expected.json-lines b/tests/summarycode/data/full_summary/summary_key_files-details.expected.json-lines index 0e0b2f40552..42d87e989e4 100644 --- a/tests/summarycode/data/full_summary/summary_key_files-details.expected.json-lines +++ b/tests/summarycode/data/full_summary/summary_key_files-details.expected.json-lines @@ -27,7 +27,7 @@ "license_expressions": [ { "value": "zlib", - "count": 12 + "count": 19 }, { "value": null, @@ -598,9 +598,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 + } } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 42.86, @@ -784,9 +823,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 + } } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 20.34, @@ -1504,9 +1582,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 + } } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 42.86, @@ -1598,9 +1715,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 + } } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 40.0, @@ -1692,9 +1848,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 + } } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 50.0, @@ -1878,9 +2073,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 + } } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 37.5, @@ -1972,9 +2206,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 + } } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 20.34, diff --git a/tests/summarycode/data/full_summary/summary_key_files.expected.json b/tests/summarycode/data/full_summary/summary_key_files.expected.json index 5df2ff745bc..5aa195c0392 100644 --- a/tests/summarycode/data/full_summary/summary_key_files.expected.json +++ b/tests/summarycode/data/full_summary/summary_key_files.expected.json @@ -24,7 +24,7 @@ "license_expressions": [ { "value": "zlib", - "count": 12 + "count": 19 }, { "value": null, @@ -964,9 +964,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 42.86, @@ -1142,9 +1181,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 20.34, @@ -1588,9 +1666,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown":false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown":false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 42.86, @@ -1678,9 +1795,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown":false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown":false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 40.0, @@ -1768,9 +1924,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown":false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown":false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 50.0, @@ -2585,9 +2780,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown": false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 37.5, @@ -2675,9 +2909,48 @@ "match_coverage": 100.0, "rule_relevance": 100 } + }, + { + "key": "zlib", + "score": 100.0, + "name": "ZLIB License", + "short_name": "ZLIB License", + "category": "Permissive", + "is_exception": false, + "is_unknown":false, + "owner": "zlib", + "homepage_url": "http://www.zlib.net/", + "text_url": "http://www.gzip.org/zlib/zlib_license.html", + "reference_url": "https://scancode-licensedb.aboutcode.org/zlib", + "scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.LICENSE", + "scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/zlib.yml", + "spdx_license_key": "Zlib", + "spdx_url": "https://spdx.org/licenses/Zlib", + "start_line": 6, + "end_line": 23, + "matched_rule": { + "identifier": "zlib_17.RULE", + "license_expression": "zlib", + "licenses": [ + "zlib" + ], + "referenced_filenames": [], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "is_license_intro": false, + "has_unknown": false, + "matcher": "2-aho", + "rule_length": 144, + "matched_length": 144, + "match_coverage": 100.0, + "rule_relevance": 100 } + } ], "license_expressions": [ + "zlib", "zlib" ], "percentage_of_license_text": 20.34,