What's new?
PHP 1.0
- Bug fixing - see PHP 1.0 - Bug Fix List
- The Regular Expression engine used to interpret the Regular Expressions defined in the Quality Rule configuration has changed. BOOST is now used in place of TCL. Please see http://www.boost.org/doc/libs/1_52_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html for more information about BOOST.
- In this release, the manual preprocessing step is no longer required - it is actioned automatically just prior to an analysis. See the Source code preprocessing section in PHP 1.0 - Analysis Configuration for more information.
PHP 1.0.1
- Bug fixing only - see PHP 1.0 - Bug Fix List
PHP 1.0.2
- Bug fixing - see PHP 1.0 - Bug Fix List
Improvements have been made to the PHP Code Sniffer that CAST uses as part of this extension. CAST therefore recommends that you install the new version "php_sniffer_install.zip" provided inside the package as described in PHP 1.0 - Analysis Configuration. Note that if you already havea previous version of the PHP Code Sniffer installed, CAST recommends that you remove the physical folder where the previous PHP Code Sniffer has been installed before starting the installation of the new PHP Code Sniffer.
- Updated the list of Quality Rules calculated by the PHP Code Sniffer - see section below.
- Updated the documentation of PHP Quality Rules and Metrics - see section below.
PHP 1.0.3
- Bug fixing - see PHP 1.0 - Bug Fix List
- This version of the PHP Language Pack is supported on CAST databases installed on Microsoft SQL Server. For supported versions of Microsoft SQL Server, please see the CAST AIP compatibility and Supported DBMS servers section below.
Please note due to a bug in CAST AIP, upgrading from CAST AIP 7.0.x with a legacy PHP extension to CAST AIP 7.3.x (where x < 5) with PHP 1.0.3 is not supported on Microsoft SQL Server.
PHP 1.0.4
- In this release, a sample CAST Transaction Configuration Center (TCC) configuration file (.TCCsetup) is provided. This file can be imported into TCC (see PHP 1.0 - Sample of TCC Configuration for FP computation) and it provides a basic configuration for transactions entry and end points.
- Bug fixing - see PHP 1.0 - Bug Fix List
- Function Points (transactions): a green tick indicates that OMG Function Point counting and Transaction Risk Index are supported
- Quality and Sizing: a green tick indicates that CAST can measure size and that a minimum set of Quality Rules exist
Function Points (transactions) | Quality and Sizing |
---|---|
Supported DBMS servers
CAST recommends that you always install the latest release of an extension.
Extension Version | AIP 7.3.x | AIP 8.0.x | AIP 8.1.x | AIP 8.2.x | Supported DBMS servers |
---|---|---|---|---|---|
1.0.4 | This version of the extension is supported with all RDBMS/CAST Storage Services supported for CAST AIP. | ||||
1.0.3 | |||||
1.0.1 and 1.0.2 | This version of the extension is not supported on CAST databases installed on any release of Microsoft SQL Server. | ||||
1.0 | 7.3.0 - 7.3.2 |
Supported Versions of PHP
This version of the PHP extension provides partial support for the following PHP versions:
- 5.x
Licence Agreements
In order to provide a better solution and therefore increase the number of quality rules, the PHP configuration uses other external tools, such as:
PHP Code Sniffer
More information about this tool is available here: http://pear.php.net/package/PHP_CodeSniffer
Version
CAST ships version 1.5.2 of the PHP Code Sniffer.
License
The licence agreement for the PHP Code Sniffer tool is available here:
and is detailed below:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Quality Rules calculated by the PHP Code Sniffer tool
1007022 | Avoid FOR loops which can be simplified to a WHILE loop (PHP) |
1007024 | Avoid incrementer jumbling in loops (PHP) |
1007026 | Avoid using identical type operators rather than EQUAL operators (PHP) |
1007028 | Avoid using increment/decrement operator (PHP) |
1007030 | Avoid using empty statement (PHP) |
1007032 | Avoid empty class definition (PHP) |
1007034 | Avoid empty style definition (PHP) |
1007036 | Avoid classes having too many children (PHP) |
1007038 | Avoid classes having too many dependencies (PHP) |
1007040 | Avoid classes having too many parents (PHP) |
1007046 | Avoid Classes and Interfaces with a High Depth of Inheritance Tree (PHP) |
1007056 | Avoid unnecessary final modifiers inside final Classes (PHP) |
1007058 | Avoid unused Function parameters (PHP) |
1007080 | Avoid Classes not having the same name as the file (PHP) |
1007084 | Avoid uppercase keywords for control structures in Sections(PHP) |
1007086 | Avoid uppercase keywords for control structures in Functions and Methods(PHP) |
1007088 | Avoid having variable with a too short name (PHP) |
1007090 | Avoid having variable with a too long name (PHP) |
1007096 | Avoid ELSEIF statements. ELSE and IF should be separate (PHP) |
1007116 | Avoid Methods with Object Instantiation in loops (PHP) |
1007124 | Avoid empty catch blocks (PHP) |
1007126 | Avoid Functions throwing exceptions and not having a @Throws tag (PHP) |
1007128 | Avoid classes exceeding maximum length (PHP) |
1007130 | Avoid methods having too many parameters (PHP) |
1007132 | Avoid methods having lenght exceeding the maximum (PHP) |
1007134 | Avoid classes with too many fields (PHP) |
1007136 | Avoid classes with too many methods (PHP) |
1007138 | Avoid classes having a number of public methods and attributs exceeds maximum (PHP) |
1007140 | Avoid having unused variables (PHP) |
1007142 | Avoid unused private fields (PHP) |
1007144 | Avoid unused private methods (PHP) |
1007146 | Avoid classes exceeding number of weighted methods (PHP) |
1007148 | Avoid unconditional IF and ELSEIF statements (PHP) |
1007150 | Avoid useless overriding Methods (PHP) |
1007152 | Avoid unassigned default values in Functions (PHP) |
1007156 | Avoid using a goto statements (PHP) |
1007158 | Avoid using eval expressions (PHP) |
1007160 | Avoid using exit expressions (PHP) |
PHPMD
More information about this tool is available here: http://phpmd.org/
The licence agreement for the PHPMD tool is available available in the file "LICENSE.txt" delivered in the source folder of the tool and is detailed below:
Copyright (c) 2009-2011, Manuel Pichler <mapi@phpmd.org>.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Manuel Pichler nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PHP Depend
More information about this tool is available here: http://pdepend.org/
The licence agreement for the PHP Depend tool is available in the file "LICENSE.txt" delivered in the source folder of the tool and is detailed below:
Copyright (c) 2008-2012, Manuel Pichler <mapi@pdepend.org>.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Manuel Pichler nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Documentation of PHP Quality Rules and Metrics
Documentation of all CAST Metrics and Quality Rules specific to the PHP extension is delivered via a compiled HTML Help file (CHM). Please ensure that once the CHM has been downloaded you right-click on the CHM file in Windows Explorer and choose Properties > Unblock. This will ensure that the CHM is readable on your own PC:
Version | CHM |
---|---|
1.0.3 and 1.0.4 | metrics_PHP_1-0-3.chm |
1.0.2 | metrics_PHP_1-0-2.chm |
1.0 and 1.0.1 | metrics_PHP_1-0.chm |