Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/summarycode/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ def compute_license_score(codebase):
if scoring_elements.declared_license:
scoring_elements.score += 40

scoring_elements.precise_license_detection = check_declared_licenses(declared_licenses)
if scoring_elements.precise_license_detection:
scoring_elements.identification_precision = check_declared_licenses(declared_licenses)
if scoring_elements.identification_precision:
scoring_elements.score += 40

scoring_elements.has_license_text = check_for_license_texts(declared_licenses)
Expand Down Expand Up @@ -203,7 +203,7 @@ def unique(objects):
class ScoringElements:
score = attr.ib(default=0)
declared_license = attr.ib(default=False)
precise_license_detection = attr.ib(default=False)
identification_precision = attr.ib(default=False)
has_license_text = attr.ib(default=False)
declared_copyrights = attr.ib(default=False)
conflicting_license_categories = attr.ib(default=False)
Expand All @@ -213,7 +213,7 @@ def to_dict(self):
return {
'score': self.score,
'declared_license': self.declared_license,
'precise_license_detection': self.precise_license_detection,
'identification_precision': self.identification_precision,
'has_license_text': self.has_license_text,
'declared_copyrights': self.declared_copyrights,
'conflicting_license_categories': self.conflicting_license_categories,
Expand Down
27 changes: 0 additions & 27 deletions tests/summarycode/data/classify/cli.expected.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--classify": true,
"--info": true,
"--json-pp": "<file>"
},
"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": [],
"warnings": [],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 8
}
}
],
"files": [
{
"path": "cli",
Expand Down
31 changes: 0 additions & 31 deletions tests/summarycode/data/facet/cli.expected.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--facet": [
"dev=*.c",
"tests=*/tests/*",
"data=*.json",
"docs=*/docs/*"
],
"--json-pp": "<file>"
},
"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": [],
"warnings": [],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 56
}
}
],
"files": [
{
"path": "cli",
Expand Down
26 changes: 0 additions & 26 deletions tests/summarycode/data/generated/cli.expected.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--generated": true,
"--json-pp": "<file>"
},
"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": [],
"warnings": [],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 7
}
}
],
"files": [
{
"path": "simple",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--consolidate": true,
"--copyright": true,
"--info": true,
"--json": "<file>",
"--license": true,
"--package": 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": [],
"warnings": [
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 8
}
}
],
"dependencies": [],
"packages": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,60 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
"--info": true,
"--json": "<file>",
"--license": true,
"--package": 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": [],
"warnings": [],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 7
}
},
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--consolidate": true,
"--from-json": true,
"--json": "<file>"
},
"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": [],
"warnings": [
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 7
}
}
],
"dependencies": [],
"packages": [
{
Expand Down
54 changes: 0 additions & 54 deletions tests/summarycode/data/plugin_consolidate/e2fsprogs-expected.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": [
"e2fsprogs-1.45.4"
],
"--copyright": true,
"--email": true,
"--info": true,
"--json-pp": "e2fsprogs-1.45.4-a-no-configure.json",
"--license": true,
"--max-in-memory": 0,
"--package": true,
"--processes": "6",
"--url": 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": null,
"message": null,
"errors": [],
"warnings": [],
"extra_data": {
"files_count": 2183
}
},
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--consolidate": true,
"--from-json": true,
"--json": "<file>"
},
"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": [],
"warnings": [
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 2183
}
}
],
"consolidated_components": [
{
"type": "holders",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--consolidate": true,
"--copyright": true,
"--info": true,
"--json": "<file>",
"--license": true,
"--package": 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": [],
"warnings": [
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 3
}
}
],
"dependencies": [],
"packages": [],
"consolidated_components": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--consolidate": true,
"--copyright": true,
"--info": true,
"--json": "<file>",
"--license": true,
"--package": 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": [],
"warnings": [
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 2
}
}
],
"dependencies": [],
"packages": [],
"consolidated_components": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--consolidate": true,
"--copyright": true,
"--info": true,
"--json": "<file>",
"--license": true,
"--package": 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": [],
"warnings": [
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 6
}
}
],
"dependencies": [],
"packages": [
{
Expand Down
Loading