phpmd / phpmd

PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly frontend application for the raw metrics stream measured by PHP Depend.

Home Page:https://phpmd.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Gitlab renderer for Gitlab CI

metalmini opened this issue · comments

Description

There is a Github renderer at the moment, so it only makes sense to also add a Gitlab version. There are some ways to convert the json output, but that also requires additional software to parse the json output and nobody wants that kind of strain on the runners.

As far as i can tell the output should look something like this:

[
  {
    "type": "issue",
    "categories": [
      "Style",
      "PHP"
    ],
    "check_name": "ExcessiveClassComplexity",
    "fingerprint": "/var/www/html/app/SomeFile.php:31:ExcessiveClassComplexity",
    "description": "The class SomeFile has an overall complexity of 51 which is very high. The configured complexity threshold is 50.",
    "severity": "unknown",
    "location": {
      "path": "/var/www/html/app/SomeFile.php",
      "lines": {
        "begin": 31,
        "end": 2772
      }
    }
  },
]

Checks before submitting

  • Be sure that there isn't already an issue about this. See: Issues list
  • Be sure that there isn't already a pull request about this. See: Pull requests
  • Tell if you have the option to provide the code for this proposal.
  • This issue is about 1 feature proposal and nothing more.
  • The issue has a descriptive title. For example: "Add JSON render option".

@metalmini thanks for the idea, I think it can be a nice addition.

Are you able to create a PR for this?

@tvbeek i will give it a go if i find some spare time.

@tvbeek i added a PR, i don't do this very often for public projects so be gentle 😉

#957

@metalmini thanks for the PR. It is very nice to see someone writing a good idea to add and implementing the code for it. 👍