-
-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a class to store scoring elements #2861
Signed-off-by: Jono Yang <jyang@nexb.com>
- Loading branch information
Showing
2 changed files
with
271 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
234 changes: 234 additions & 0 deletions
234
tests/summarycode/data/score2/imprecise_license-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,234 @@ | ||
{ | ||
"headers": [ | ||
{ | ||
"tool_name": "scancode-toolkit", | ||
"options": { | ||
"input": "<path>", | ||
"--classify": true, | ||
"--copyright": true, | ||
"--info": true, | ||
"--json": "<file>", | ||
"--license": true, | ||
"--license-clarity-score-2": 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.", | ||
"output_format_version": "2.0.0", | ||
"message": null, | ||
"errors": [], | ||
"extra_data": { | ||
"spdx_license_list_version": "3.16", | ||
"files_count": 3 | ||
} | ||
} | ||
], | ||
"license_clarity_score": { | ||
"score": 90, | ||
"declared_license": true, | ||
"precise_license_detection": true, | ||
"has_license_text": false, | ||
"declared_copyrights": true, | ||
"conflicting_license_categories": false, | ||
"ambigous_compound_licensing": false | ||
}, | ||
"files": [ | ||
{ | ||
"path": "imprecise_license", | ||
"type": "directory", | ||
"name": "imprecise_license", | ||
"base_name": "imprecise_license", | ||
"extension": "", | ||
"size": 0, | ||
"sha1": null, | ||
"md5": null, | ||
"sha256": null, | ||
"mime_type": null, | ||
"file_type": null, | ||
"programming_language": null, | ||
"is_binary": false, | ||
"is_text": false, | ||
"is_archive": false, | ||
"is_media": false, | ||
"is_source": false, | ||
"is_script": false, | ||
"licenses": [], | ||
"license_expressions": [], | ||
"percentage_of_license_text": 0, | ||
"copyrights": [], | ||
"holders": [], | ||
"authors": [], | ||
"is_legal": false, | ||
"is_manifest": false, | ||
"is_readme": false, | ||
"is_top_level": true, | ||
"is_key_file": false, | ||
"files_count": 3, | ||
"dirs_count": 0, | ||
"size_count": 2179, | ||
"scan_errors": [] | ||
}, | ||
{ | ||
"path": "imprecise_license/README.md", | ||
"type": "file", | ||
"name": "README.md", | ||
"base_name": "README", | ||
"extension": ".md", | ||
"size": 333, | ||
"sha1": "6ad868c919fb46bb2e1dd203807915877710e305", | ||
"md5": "3010ccc5b2e6c635308485b84d2e8d8f", | ||
"sha256": "ed83c367801018f9b7e2d7c3d024d5f0fb3c6112fbf77ef2e6a1c05d7fd65c7a", | ||
"mime_type": "text/plain", | ||
"file_type": "ASCII text", | ||
"programming_language": null, | ||
"is_binary": false, | ||
"is_text": true, | ||
"is_archive": false, | ||
"is_media": false, | ||
"is_source": false, | ||
"is_script": false, | ||
"licenses": [ | ||
{ | ||
"key": "apache-2.0", | ||
"score": 100.0, | ||
"name": "Apache License 2.0", | ||
"short_name": "Apache 2.0", | ||
"category": "Permissive", | ||
"is_exception": false, | ||
"is_unknown": false, | ||
"owner": "Apache Software Foundation", | ||
"homepage_url": "http://www.apache.org/licenses/", | ||
"text_url": "http://www.apache.org/licenses/LICENSE-2.0", | ||
"reference_url": "https://scancode-licensedb.aboutcode.org/apache-2.0", | ||
"scancode_text_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/apache-2.0.LICENSE", | ||
"scancode_data_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/apache-2.0.yml", | ||
"spdx_license_key": "Apache-2.0", | ||
"spdx_url": "https://spdx.org/licenses/Apache-2.0", | ||
"start_line": 19, | ||
"end_line": 19, | ||
"matched_rule": { | ||
"identifier": "apache-2.0_1050.RULE", | ||
"license_expression": "apache-2.0", | ||
"licenses": [ | ||
"apache-2.0" | ||
], | ||
"referenced_filenames": [], | ||
"is_license_text": false, | ||
"is_license_notice": false, | ||
"is_license_reference": true, | ||
"is_license_tag": false, | ||
"is_license_intro": false, | ||
"has_unknown": false, | ||
"matcher": "2-aho", | ||
"rule_length": 2, | ||
"matched_length": 2, | ||
"match_coverage": 100.0, | ||
"rule_relevance": 100 | ||
} | ||
} | ||
], | ||
"license_expressions": [ | ||
"apache-2.0" | ||
], | ||
"percentage_of_license_text": 4.55, | ||
"copyrights": [ | ||
{ | ||
"copyright": "Copyright (c) Example, Inc.", | ||
"start_line": 18, | ||
"end_line": 18 | ||
} | ||
], | ||
"holders": [ | ||
{ | ||
"holder": "Example, Inc.", | ||
"start_line": 18, | ||
"end_line": 18 | ||
} | ||
], | ||
"authors": [], | ||
"is_legal": false, | ||
"is_manifest": false, | ||
"is_readme": true, | ||
"is_top_level": true, | ||
"is_key_file": true, | ||
"files_count": 0, | ||
"dirs_count": 0, | ||
"size_count": 0, | ||
"scan_errors": [] | ||
}, | ||
{ | ||
"path": "imprecise_license/index.js", | ||
"type": "file", | ||
"name": "index.js", | ||
"base_name": "index", | ||
"extension": ".js", | ||
"size": 1037, | ||
"sha1": "53771edd1e0765de7400174e42ca2e8e5840055f", | ||
"md5": "ec9dc4294f83d24294f07e6a0676c338", | ||
"sha256": "2b61833228890116dded1849a683d31d0273e0cf985a7bf0cc419aa7edefd839", | ||
"mime_type": "text/plain", | ||
"file_type": "ASCII text", | ||
"programming_language": "JavaScript", | ||
"is_binary": false, | ||
"is_text": true, | ||
"is_archive": false, | ||
"is_media": false, | ||
"is_source": true, | ||
"is_script": false, | ||
"licenses": [], | ||
"license_expressions": [], | ||
"percentage_of_license_text": 0, | ||
"copyrights": [], | ||
"holders": [], | ||
"authors": [], | ||
"is_legal": false, | ||
"is_manifest": false, | ||
"is_readme": false, | ||
"is_top_level": true, | ||
"is_key_file": false, | ||
"files_count": 0, | ||
"dirs_count": 0, | ||
"size_count": 0, | ||
"scan_errors": [] | ||
}, | ||
{ | ||
"path": "imprecise_license/package.json", | ||
"type": "file", | ||
"name": "package.json", | ||
"base_name": "package", | ||
"extension": ".json", | ||
"size": 809, | ||
"sha1": "c07fce758705b949299768f7a404a51ce31ead7a", | ||
"md5": "6670be3f86bde3893f575303b9b33b24", | ||
"sha256": "77891e545535e7cd9b8de9eb9633d60083e17a4120c2edb5181cef3abd906c9f", | ||
"mime_type": "application/json", | ||
"file_type": "JSON data", | ||
"programming_language": null, | ||
"is_binary": false, | ||
"is_text": true, | ||
"is_archive": false, | ||
"is_media": false, | ||
"is_source": false, | ||
"is_script": false, | ||
"licenses": [], | ||
"license_expressions": [], | ||
"percentage_of_license_text": 0, | ||
"copyrights": [], | ||
"holders": [], | ||
"authors": [ | ||
{ | ||
"author": "Alexander Plavinski <alexander.plavinski@invision.de>", | ||
"start_line": 6, | ||
"end_line": 6 | ||
} | ||
], | ||
"is_legal": false, | ||
"is_manifest": true, | ||
"is_readme": false, | ||
"is_top_level": true, | ||
"is_key_file": true, | ||
"files_count": 0, | ||
"dirs_count": 0, | ||
"size_count": 0, | ||
"scan_errors": [] | ||
} | ||
] | ||
} |