Giter VIP home page Giter VIP logo

plog-converter's Introduction

Plog Converter

Docs Platforms

Note. This page is about the tool for Linux and macOS. The appropriate page about the tool for Windows is available here.

To convert the analyzer bug report to different formats (xml, tasks and so on) you can use the Plog Converter. It is applicable for cross-platform working scenarios (C++, Java) on all supported operating systems when checking Makefile, CMake, QMake, Ninja, WAF projects.

More detailed description is available on the documentation page, section "Plog Converter Utility".

Compilation

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make

Usage

An example of a command that will be suitable for most users for opening the report in QtCreator:

plog-converter -a GA:1,2 -t tasklist -o /path/to/project.tasks /path/to/project.log

plog-converter's People

Contributors

buzzms avatar cerg2010cerg2010 avatar comeinrage avatar darckore avatar darkwanderer avatar egor18 avatar evtihevich avatar georgegribkov avatar govorovviva64 avatar ichbinnikola avatar ichnikola avatar ilyagainulin avatar khandeliants avatar konstantinkochkin avatar kulikovk avatar kurenevalexandr avatar minatych avatar mixxxxa avatar mrdvorak avatar ovsyannikovviva64 avatar skhrenov avatar stolyarrrov avatar sviatoslavrazmyslov avatar valerykomarov avatar vasilievserg avatar vivaat avatar vkhanieva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plog-converter's Issues

plog-converter generates invalid SARIF files

I'm trying to use plog-converter to generate SARIF files, which are then uploaded to github via the github/codeql-action/upload-sarif@v1 github action. Unfortunately, it appears that the plog-converter generates duplicate items, causing the SARIF verification to fail on upload.

Version: pvs-studio (7.14.50353.142-1)
Command used to convert: plog-converter -a GA:1,2 -o project.sarif -t sarif project.log
The input file: project.log
The resulting output file: project.sarif

Full run with all logs is available here;: https://github.com/bgianfo/serenity/runs/3573864357?check_suite_focus=true

The errors we are getting from the SARIF files look like:

Error details: instance.runs[0].results[61].relatedLocations contains duplicate item
  {
    "property": "instance.runs[0].results[61].relatedLocations",
    "message": "contains duplicate item",
    "schema": {
      "description": "A set of locations relevant to this result.",
      "type": "array",
      "minItems": 0,
      "uniqueItems": true,
      "default": [],
      "items": {
        "$ref": "#/definitions/location"
      }
    },
    "instance": [
      {
        "message": {
          "text": "Consider inspecting the 'exchange' function. The return value is not always used. Total calls: 44, discarded results: 4."
        },
        "physicalLocation": {
          "artifactLocation": {
            "uri": "file:///home/runner/work/serenity/serenity/AK/RefPtr.h"
          },
          "region": {
            "endColumn": 2147483647,
            "endLine": 211,
            "startColumn": 1,
            "startLine": 211
          }
        }
      },
      {
        "message": {
          "text": "Consider inspecting the 'exchange' function. The return value is not always used. Total calls: 44, discarded results: 4."
        },
        "physicalLocation": {
          "artifactLocation": {
            "uri": "file:///home/runner/work/serenity/serenity/AK/RefPtr.h"
          },
          "region": {
            "endColumn": 2147483647,
            "endLine": 202,
            "startColumn": 1,
            "startLine": 202
          }
        }
      },
      {
        "message": {
          "text": "Consider inspecting the 'exchange' function. The return value is not always used. Total calls: 44, discarded results: 4."
        },
        "physicalLocation": {
          "artifactLocation": {
            "uri": "file:///home/runner/work/serenity/serenity/AK/RefPtr.h"
          },
          "region": {
            "endColumn": 2147483647,
            "endLine": 211,
            "startColumn": 1,
            "startLine": 211
          }
        }
      },
      {
        "message": {
          "text": "Consider inspecting the 'exchange' function. The return value is not always used. Total calls: 44, discarded results: 4."
        },
        "physicalLocation": {
          "artifactLocation": {
            "uri": "file:///home/runner/work/serenity/serenity/AK/RefPtr.h"
          },
          "region": {
            "endColumn": 2147483647,
            "endLine": 202,
            "startColumn": 1,
            "startLine": 202
          }
        }
      }
    ],
    "name": "uniqueItems",
    "stack": "instance.runs[0].results[61].relatedLocations contains duplicate item"
  }

Incorrect SARIF file if there is no issues in the code

When running PVS-Studio on the code which have all the issues resolved plog-converter app produces SARIF file like this:

{
  "version": "2.1.0",
  "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
  "runs": [
    {
      "tool": {
        "driver": {
          "name": "PVS-Studio",
          "semanticVersion": "7.21.64848.262",
          "informationUri": "https://pvs-studio.com",
          "rules": null
        }
      },
      "results": null
    }
  ]
}

According to JSON Schema results and rules properties can not be null. Instead they should be an empty array []
Here is example of a GitHub pipeline where this issue was found.

As a temp workaround I added following two lines after running plog-converter:

sed -i 's/"results": null/"results": []/g' pvs-report.sarif
sed -i 's/"rules": null/"rules": []/g' pvs-report.sarif

It helps, but looks dirty

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.