Skip to content

Several errors in the display of license detection data #563

@johnmhoran

Description

@johnmhoran

Using SCWB 4.0.0rc2 on WSL2 Ubuntu-20.04 on Windows 10.

I see what I think is another bug in SCWB's display of the JSON license detection data. This has 2 pieces to the display problem. The file is zjsonpatch-0.3.0.jar-v32rc4results.json.

  1. Similar to the issue I opened earlier (see License detections explorer indicates 2 detections but displays just 1 #562), the left-hand display shows 5 rows of 1 apache-2.0 detection each, but the last 2 rows have no data and simply say No Rows To Show. I think this is the relevant portion of the JSON file (rows 239-270):
  "license_detections": [
    {
      "identifier": "apache_2_0-8352cbe6-d199-3a43-cdc8-b14a837e2ce6",
      "license_expression": "apache-2.0",
      "detection_count": 1,
      "detection_log": []
    },
    {
      "identifier": "apache_2_0-c4e30bcd-ccfd-bbc3-d2f1-196ab911e47d",
      "license_expression": "apache-2.0",
      "detection_count": 1,
      "detection_log": []
    },
    {
      "identifier": "apache_2_0-124b45cb-8e44-0374-5bd8-c5f8ae55fad0",
      "license_expression": "apache-2.0",
      "detection_count": 1,
      "detection_log": []
    },
    {
      "identifier": "apache_2_0-daaaee76-1395-c8c8-e06a-3f3f76e079b1",
      "license_expression": "apache-2.0",
      "detection_count": 1,
      "detection_log": []
    },
    {
      "identifier": "apache_2_0-e6b67d43-b657-21c0-8d8b-17f617aef8ce",
      "license_expression": "apache-2.0",
      "detection_count": 1,
      "detection_log": []
    }
  ],

Here's a screenshot:
image

  1. There is also another license_detections key/value pair, and this one shows scores for 2 detected licenses/files, one of which is a score of 80 -- but SCWB does not display any score of 80. Even more curious, the 2 identifiers in this JSON extract are the same as the identifiers for the 2 rows of the 5 that are empty. Rows 119-158:
      "license_detections": [
        {
          "license_expression": "apache-2.0",
          "matches": [
            {
              "score": 100.0,
              "start_line": 1,
              "end_line": 1,
              "matched_length": 7,
              "match_coverage": 100.0,
              "matcher": "1-hash",
              "license_expression": "apache-2.0",
              "rule_identifier": "apache-2.0_5.RULE",
              "rule_relevance": 100,
              "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_5.RULE",
              "matched_text": "The Apache Software License, Version 2.0"
            }
          ],
          "identifier": "apache_2_0-daaaee76-1395-c8c8-e06a-3f3f76e079b1"
        },
        {
          "license_expression": "apache-2.0",
          "matches": [
            {
              "score": 80.0,
              "start_line": 1,
              "end_line": 1,
              "matched_length": 9,
              "match_coverage": 100.0,
              "matcher": "1-hash",
              "license_expression": "apache-2.0",
              "rule_identifier": "apache-2.0_42.RULE",
              "rule_relevance": 80,
              "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_42.RULE",
              "matched_text": "http://www.apache.org/licenses/LICENSE-2.0.txt"
            }
          ],
          "identifier": "apache_2_0-e6b67d43-b657-21c0-8d8b-17f617aef8ce"
        }
      ],

It's possible I am reading the JSON incorrectly, but I don't think so, and in any event, it is clear that 2 of the 5 detection rows are empty in SCWB.

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