Skip to content

Commit

Permalink
Merge pull request #652 from kylekatarnls/feature/650-fix-tables
Browse files Browse the repository at this point in the history
Fix #650 Use pretty tables to handle multi-line
  • Loading branch information
tvbeek committed Aug 5, 2019
2 parents 2c1d460 + 47564c3 commit b487b11
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 137 deletions.
41 changes: 26 additions & 15 deletions src/site/rst/documentation/ant-task.rst
Expand Up @@ -58,15 +58,25 @@ Parameters

The following attributes can be defined on the PHPMD task xml-element.

===================== ========================================================================================================================= ================================================
Attribute Description Required
===================== ========================================================================================================================= ================================================
rulesetfiles A comma delimited list of ruleset files ('rulesets/basic.xml,rulesets/design.xml') or identifiers of build-in rulesets. Yes, unless the ruleset nested element is used
failonerror Whether or not to fail the build if any errors occur while processing the files No
failOnRuleViolation Whether or not to fail the build if PHPMD finds any problems No
minimumPriority The rule priority threshold; rules with lower priority than they will not be used No
maximumPriority The rule priority threshold; rules with higher priority than this will not be used No
===================== ========================================================================================================================= ================================================
+---------------------+---------------------------------------------------+---------------------------------------------+
| Attribute | Description | Required |
+=====================+===================================================+=============================================+
| rulesetfiles | A comma delimited list of ruleset files | Yes, unless the ruleset nested element is |
| | ('rulesets/basic.xml,rulesets/design.xml') or | used |
| | identifiers of build-in rulesets. | |
+---------------------+---------------------------------------------------+---------------------------------------------+
| failonerror | Whether or not to fail the build if any errors | No |
| | occur while processing the files | |
+---------------------+---------------------------------------------------+---------------------------------------------+
| failOnRuleViolation | Whether or not to fail the build if PHPMD finds | No |
| | any problems | |
+---------------------+---------------------------------------------------+---------------------------------------------+
| minimumPriority | The rule priority threshold; rules with lower | No |
| | priority than they will not be used | |
+---------------------+---------------------------------------------------+---------------------------------------------+
| maximumPriority | The rule priority threshold; rules with higher | No |
| | priority than this will not be used | |
+---------------------+---------------------------------------------------+---------------------------------------------+

Nested xml elements
===================
Expand All @@ -76,12 +86,13 @@ which the report is written.

**Parameters**

=========== =================================================================== ==========
Attribute Description Required
=========== =================================================================== ==========
format The report output format. Supported formats are xml,html and text. Yes
toFile A filename into which the report is written Yes
=========== =================================================================== ==========
+------------+--------------------------------------------------------------------+----------+
| Attribute | Description | Required |
+============+====================================================================+==========+
| format | The report output format. Supported formats are xml,html and text. | Yes |
+------------+--------------------------------------------------------------------+----------+
| toFile | A filename into which the report is written | Yes |
+------------+--------------------------------------------------------------------+----------+

The ``<ruleset />`` xml element is another way to specify rulesets. Here
is a modified version of the previous example: ::
Expand Down
10 changes: 5 additions & 5 deletions src/site/rst/rules/cleancode.rst
Expand Up @@ -58,11 +58,11 @@ Example: ::

This rule has the following properties:

=================================== =============== ===============================================
Name Default Value Description
=================================== =============== ===============================================
exceptions Comma-separated class name list of exceptions
=================================== =============== ===============================================
+-----------------------------------+---------------+------------------------------------------------------------+
| Name | Default Value | Description |
+===================================+===============+============================================================+
| exceptions | | Comma-separated class name list of exceptions |
+-----------------------------------+---------------+------------------------------------------------------------+

IfStatementAssignment
=====================
Expand Down
119 changes: 62 additions & 57 deletions src/site/rst/rules/codesize.rst
Expand Up @@ -53,13 +53,15 @@ Example: ::

This rule has the following properties:

=================================== =============== ===================================================================
Name Default Value Description
=================================== =============== ===================================================================
reportLevel 10 The Cyclomatic Complexity reporting threshold
showClassesComplexity true Indicate if class average violation should be added to the report
showMethodsComplexity true Indicate if class average violation should be added to the report
=================================== =============== ===================================================================
+-----------------------------------+---------------+-------------------------------------------------------------------+
| Name | Default Value | Description |
+===================================+===============+===================================================================+
| reportLevel | 10 | The Cyclomatic Complexity reporting threshold |
+-----------------------------------+---------------+-------------------------------------------------------------------+
| showClassesComplexity | true | Indicate if class average violation should be added to the report |
+-----------------------------------+---------------+-------------------------------------------------------------------+
| showMethodsComplexity | true | Indicate if class average violation should be added to the report |
+-----------------------------------+---------------+-------------------------------------------------------------------+

NPathComplexity
===============
Expand All @@ -78,11 +80,11 @@ Example: ::

This rule has the following properties:

=================================== =============== ===============================
Name Default Value Description
=================================== =============== ===============================
minimum 200 The npath reporting threshold
=================================== =============== ===============================
+-----------------------------------+---------------+-------------------------------+
| Name | Default Value | Description |
+===================================+===============+===============================+
| minimum | 200 | The npath reporting threshold |
+-----------------------------------+---------------+-------------------------------+

ExcessiveMethodLength
=====================
Expand All @@ -103,12 +105,13 @@ Example: ::

This rule has the following properties:

=================================== =============== =========================================
Name Default Value Description
=================================== =============== =========================================
minimum 100 The method size reporting threshold
ignore-whitespace false Count whitespace in reporting threshold
=================================== =============== =========================================
+-----------------------------------+---------------+-----------------------------------------+
| Name | Default Value | Description |
+===================================+===============+=========================================+
| minimum | 100 | The method size reporting threshold |
+-----------------------------------+---------------+-----------------------------------------+
| ignore-whitespace | false | Count whitespace in reporting threshold |
+-----------------------------------+---------------+-----------------------------------------+

ExcessiveClassLength
====================
Expand All @@ -127,12 +130,13 @@ Example: ::

This rule has the following properties:

=================================== =============== =========================================
Name Default Value Description
=================================== =============== =========================================
minimum 1000 The class size reporting threshold
ignore-whitespace false Count whitespace in reporting threshold
=================================== =============== =========================================
+-----------------------------------+---------------+-----------------------------------------+
| Name | Default Value | Description |
+===================================+===============+=========================================+
| minimum | 1000 | The class size reporting threshold |
+-----------------------------------+---------------+-----------------------------------------+
| ignore-whitespace | false | Count whitespace in reporting threshold |
+-----------------------------------+---------------+-----------------------------------------+

ExcessiveParameterList
======================
Expand All @@ -152,11 +156,11 @@ Example: ::

This rule has the following properties:

=================================== =============== =========================================
Name Default Value Description
=================================== =============== =========================================
minimum 10 The parameter count reporting threshold
=================================== =============== =========================================
+-----------------------------------+---------------+-----------------------------------------+
| Name | Default Value | Description |
+===================================+===============+=========================================+
| minimum | 10 | The parameter count reporting threshold |
+-----------------------------------+---------------+-----------------------------------------+

ExcessivePublicCount
====================
Expand All @@ -181,11 +185,11 @@ Example: ::

This rule has the following properties:

=================================== =============== =====================================
Name Default Value Description
=================================== =============== =====================================
minimum 45 The public item reporting threshold
=================================== =============== =====================================
+-----------------------------------+---------------+-----------------------------------------+
| Name | Default Value | Description |
+===================================+===============+=========================================+
| minimum | 45 | The public item reporting threshold |
+-----------------------------------+---------------+-----------------------------------------+

TooManyFields
=============
Expand All @@ -205,11 +209,11 @@ Example: ::

This rule has the following properties:

=================================== =============== ======================================
Name Default Value Description
=================================== =============== ======================================
maxfields 15 The field count reporting threshold
=================================== =============== ======================================
+-----------------------------------+---------------+-----------------------------------------+
| Name | Default Value | Description |
+===================================+===============+=========================================+
| maxfields | 15 | The field count reporting threshold |
+-----------------------------------+---------------+-----------------------------------------+

TooManyMethods
==============
Expand All @@ -220,12 +224,13 @@ A class with too many methods is probably a good suspect for refactoring, in ord

This rule has the following properties:

=================================== =============== ======================================
Name Default Value Description
=================================== =============== ======================================
maxmethods 25 The method count reporting threshold
ignorepattern (^(set|get))i Ignore methods matching this regex
=================================== =============== ======================================
+-----------------------------------+---------------+--------------------------------------+
| Name | Default Value | Description |
+===================================+===============+======================================+
| maxmethods | 25 | The method count reporting threshold |
+-----------------------------------+---------------+--------------------------------------+
| ignorepattern | (^(set|get))i | Ignore methods matching this regex |
+-----------------------------------+---------------+--------------------------------------+

TooManyPublicMethods
====================
Expand All @@ -236,12 +241,13 @@ A class with too many public methods is probably a good suspect for refactoring,

This rule has the following properties:

=================================== =============== ======================================
Name Default Value Description
=================================== =============== ======================================
maxmethods 10 The method count reporting threshold
ignorepattern (^(set|get))i Ignore methods matching this regex
=================================== =============== ======================================
+-----------------------------------+---------------+-----------------------------------------+
| Name | Default Value | Description |
+===================================+===============+=========================================+
| maxmethods | 10 | The method count reporting threshold |
+-----------------------------------+---------------+-----------------------------------------+
| ignorepattern | (^(set|get))i | Ignore methods matching this regex |
+-----------------------------------+---------------+-----------------------------------------+

ExcessiveClassComplexity
========================
Expand Down Expand Up @@ -278,16 +284,15 @@ Example: ::

This rule has the following properties:

=================================== =============== ========================================
Name Default Value Description
=================================== =============== ========================================
maximum 50 The maximum WMC tolerable for a class.
=================================== =============== ========================================
+-----------------------------------+---------------+-----------------------------------------+
| Name | Default Value | Description |
+===================================+===============+=========================================+
| maximum | 50 | The maximum WMC tolerable for a class. |
+-----------------------------------+---------------+-----------------------------------------+

Remark
======

This document is based on a ruleset xml-file, that was taken from the original source of the `PMD`__ project. This means that most parts of the content on this page are the intellectual work of the PMD community and its contributors and not of the PHPMD project.

__ http://pmd.sourceforge.net/

0 comments on commit b487b11

Please sign in to comment.