Skip to content

MIT reported as "CC-BY-3.0 AND MIT" #3861

@stefan6419846

Description

@stefan6419846

Description

https://github.com/jborean93/smbprotocol/blob/master/src/smbprotocol/query_info.py is wrongly being detected as being MIT AND LicenseRef-scancode-unknown-license-reference AND (CC-BY-3.0 AND MIT), where especially the Creative Commons detection is wrong.

How To Reproduce

  • wget https://github.com/jborean93/smbprotocol/raw/2ce49ef644e931d5cd426c2feee730012efc057f/src/smbprotocol/query_info.py
  • scancode -l --license-text --license-text-diagnostics --yaml error.yml query_info.py
  • cat error.yml

Result

headers:
    -   tool_name: scancode-toolkit
        tool_version: 32.2.0
        options:
            input:
                - query_info.py
            --license: yes
            --license-text: yes
            --license-text-diagnostics: yes
            --yaml: error.yml
        notice: |
            Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES
            OR CONDITIONS OF ANY KIND, either express or implied. No content created from
            ScanCode should be considered or used as legal advice. Consult an Attorney
            for any legal advice.
            ScanCode is a free software code scanning tool from nexB Inc. and others.
            Visit https://github.com/nexB/scancode-toolkit/ for support and download.
        start_timestamp: '2024-07-15T064845.196019'
        end_timestamp: '2024-07-15T064847.577884'
        output_format_version: 3.2.0
        duration: '2.3818798065185547'
        message:
        errors: []
        warnings: []
        extra_data:
            system_environment:
                operating_system: linux
                cpu_architecture: 64
                platform: Linux-5.14.21-150400.24.100-default-x86_64-with-glibc2.31
                platform_version: '#1 SMP PREEMPT_DYNAMIC Mon Dec 4 19:12:13 UTC 2023 (3f5cd84)'
                python_version: 3.9.18 (main, Sep 06 2023, 07:49:32) [GCC]
            spdx_license_list_version: '3.24'
            files_count: 1
license_detections:
    -   identifier: mit_and_unknown_license_reference_and__cc_by_3_0_and_mit-3f4ec92f-e5ec-a537-187d-4334bc3a3c9e
        license_expression: mit AND unknown-license-reference AND (cc-by-3.0 AND mit)
        license_expression_spdx: MIT AND LicenseRef-scancode-unknown-license-reference AND (CC-BY-3.0
            AND MIT)
        detection_count: 1
        reference_matches:
            -   license_expression: mit
                license_expression_spdx: MIT
                from_file: query_info.py
                start_line: 2
                end_line: 2
                matcher: 2-aho
                score: '100.0'
                matched_length: 2
                match_coverage: '100.0'
                rule_relevance: 100
                rule_identifier: mit_14.RULE
                rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/mit_14.RULE
                matched_text: '# MIT License (see LICENSE or https://opensource.org/licenses/MIT)'
                matched_text_diagnostics: MIT License (
            -   license_expression: unknown-license-reference
                license_expression_spdx: LicenseRef-scancode-unknown-license-reference
                from_file: query_info.py
                start_line: 2
                end_line: 2
                matcher: 2-aho
                score: '100.0'
                matched_length: 2
                match_coverage: '100.0'
                rule_relevance: 100
                rule_identifier: unknown-license-reference_see-license_1.RULE
                rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/unknown-license-reference_see-license_1.RULE
                matched_text: '# MIT License (see LICENSE or https://opensource.org/licenses/MIT)'
                matched_text_diagnostics: see LICENSE
            -   license_expression: cc-by-3.0 AND mit
                license_expression_spdx: CC-BY-3.0 AND MIT
                from_file: query_info.py
                start_line: 2
                end_line: 2
                matcher: 3-seq
                score: '18.75'
                matched_length: 6
                match_coverage: '18.75'
                rule_relevance: 100
                rule_identifier: cc-by-3.0_and_mit_3.RULE
                rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/cc-by-3.0_and_mit_3.RULE
                matched_text: '# MIT License (see LICENSE or https://opensource.org/licenses/MIT)'
                matched_text_diagnostics: LICENSE [or] https://opensource.org/licenses/MIT)
files:
    -   path: query_info.py
        type: file
        detected_license_expression: mit AND unknown-license-reference AND (cc-by-3.0 AND mit)
        detected_license_expression_spdx: MIT AND LicenseRef-scancode-unknown-license-reference
            AND (CC-BY-3.0 AND MIT)
        license_detections:
            -   license_expression: mit AND unknown-license-reference AND (cc-by-3.0 AND mit)
                license_expression_spdx: MIT AND LicenseRef-scancode-unknown-license-reference
                    AND (CC-BY-3.0 AND MIT)
                matches:
                    -   license_expression: mit
                        spdx_license_expression: MIT
                        from_file: query_info.py
                        start_line: 2
                        end_line: 2
                        matcher: 2-aho
                        score: '100.0'
                        matched_length: 2
                        match_coverage: '100.0'
                        rule_relevance: 100
                        rule_identifier: mit_14.RULE
                        rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/mit_14.RULE
                        matched_text: '# MIT License (see LICENSE or https://opensource.org/licenses/MIT)'
                        matched_text_diagnostics: MIT License (
                    -   license_expression: unknown-license-reference
                        spdx_license_expression: LicenseRef-scancode-unknown-license-reference
                        from_file: query_info.py
                        start_line: 2
                        end_line: 2
                        matcher: 2-aho
                        score: '100.0'
                        matched_length: 2
                        match_coverage: '100.0'
                        rule_relevance: 100
                        rule_identifier: unknown-license-reference_see-license_1.RULE
                        rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/unknown-license-reference_see-license_1.RULE
                        matched_text: '# MIT License (see LICENSE or https://opensource.org/licenses/MIT)'
                        matched_text_diagnostics: see LICENSE
                    -   license_expression: cc-by-3.0 AND mit
                        spdx_license_expression: CC-BY-3.0 AND MIT
                        from_file: query_info.py
                        start_line: 2
                        end_line: 2
                        matcher: 3-seq
                        score: '18.75'
                        matched_length: 6
                        match_coverage: '18.75'
                        rule_relevance: 100
                        rule_identifier: cc-by-3.0_and_mit_3.RULE
                        rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/cc-by-3.0_and_mit_3.RULE
                        matched_text: '# MIT License (see LICENSE or https://opensource.org/licenses/MIT)'
                        matched_text_diagnostics: LICENSE [or] https://opensource.org/licenses/MIT)
                identifier: mit_and_unknown_license_reference_and__cc_by_3_0_and_mit-3f4ec92f-e5ec-a537-187d-4334bc3a3c9e
        license_clues: []
        percentage_of_license_text: '18.0'
        scan_errors: []

System configuration

  • What OS are you running on? Linux
  • What version of scancode-toolkit was used to generate the scan file? 32.2.0
  • What installation method was used to install/run scancode? pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions