Code Monkey home page Code Monkey logo

phpmd's Introduction

PHP Actions for Github

Run PHP Mess Detector tests in Github Actions.

PHP Mess Detector (PHPMD) takes a given PHP source code base and looks for several potential problems within that source. These problems can be things like:

  • Possible bugs
  • Suboptimal code
  • Overcomplicated expressions
  • Unused parameters, methods, properties

Usage

name: CI

on: [push]

jobs:
  build-and-test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Composer install
        uses: php-actions/composer@v6

      - name: PHP Mess Detector
        uses: php-actions/phpmd@v1
        with:
          php_version: 8.1
          path: src/
          output: text
          ruleset: test/phpmd/ruleset.xml

Version numbers

This action is released with semantic version numbers, but also tagged so the latest major release's tag always points to the latest release within the matching major version.

Please feel free to use uses: php-actions/phpmd@v1 to always run the latest version of v1, or uses: php-actions/[email protected] to specify the exact release.

Inputs

The following configuration options are available:

  • version - What version of PHPMD to use
  • php_version - What version of PHP to use
  • vendored_phpmd_path - Path to a vendored phpmd binary
  • path - A php source code filename or directory. Can be a comma-separated string
  • ruleset - A ruleset filename or a comma-separated string of rulesetfilenames
  • output - A report format
  • minimumpriority - rule priority threshold; rules with lower priority than this will not be used
  • reportfile - send report output to a file; default to STDOUT
  • suffixes - comma-separated string of valid source code filename extensions, e.g. php,phtml
  • exclude - comma-separated string of patterns that are used to ignore directories. Use asterisks to exclude by pattern. For example src/foo/.php or src/foo/
  • strict - also report those nodes with a @SuppressWarnings annotation
  • args - Extra arguments to pass to the phpmd binary

If you require other configurations of PHPMD, please request them in the Github issue tracker.


If you found this repository helpful, please consider sponsoring the developer.

phpmd's People

Contributors

g105b avatar shanept avatar

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.