snyk / snyk-to-html

export test reports from CLI to html
Other
89 stars 75 forks source link

Add descriptor for non-supported coverage and fix duplicate languages #183

Open z4ce opened 6 months ago

z4ce commented 6 months ago

What this does

Right now coverage blocks where isSupported=False and type=FAILED_PARSING end up in the coverage section of the report and cannot be differentiated from success. This change just adds the type of coverage in brackets if isSupported is false.

Example input snippet:

"properties": {
        "coverage": [
          {
            "isSupported": true,
            "lang": "XML",
            "files": 3,
            "type": "SUPPORTED"
          },
          {
            "isSupported": true,
            "lang": "HTML",
            "files": 13,
            "type": "SUPPORTED"
          },
          {
            "isSupported": true,
            "lang": "Java",
            "files": 39,
            "type": "SUPPORTED"
          },
          {
            "isSupported": false,
            "lang": "Java",
            "files": 1,
            "type": "FAILED_PARSING"
          }
        ]
      }

Right now it renders as

image

After this PR it renders as:

image

Here is an example file with a file that has failed to parse: test.json