Monday, March 21. 2011PHPMD 1.1.0 released
Version 1.1.0 of PHPMD was released on March the 20th 2011. The key features
for this release were two new rules. The first one utilizes the Coupling
Between Objects (CBO) metric to detect strongly coupled classes. The second
one detects the usage of PHP's questionable FeaturesBugfixes
DownloadYou can download release 1.1.0 through PHPMD's PEAR Channel Server or you can download the release as a Phar archive Tuesday, March 15. 2011A brief introduction to the Coupling Between Objects metricIn this blog post I will give you a brief introduction into the Coupling Between Objects metric, that is one of the metrics calculated by the static code analysis tool PHP_Depend. The Coupling Between Objects or CBO metric was originally defined by Chidamber & Kemerer in their IEEE paper "A Metrics Suite for Object Oriented Design" [1]. This software metric represents the number of other types a class or interface is coupled to. The CBO metric is calculated for classes and interfaces. It counts the unique number of reference types that occur through method calls, method parameters, return types, thrown exceptions and accessed fields. But there is an exception for types that are either a subtype or supertype of the given class, because these types are not included in the calculated CBO value. Excessive coupled classes prevent reuse of existing components and they are damaging for a modular, encapsulated software design. To improve the modularity of a software the inter coupling between different classes should be kept to a minimum. Beside reusability a high coupling has a second drawback, a class that is coupled to other classes is sensitive to changes in that classes and as a result it becomes more difficult to maintain and gets more error-prone. Additionally it is harder to test a heavly coupled class in isolation and it is harder to understand such a class. Therefore you should keep the number of dependencies at a minimum. ThresholdsBased on their research Sahraoui, Godin and Miceli [2] suggest a maximum CBO value of 14, because higher values have negative impacts on several quality aspects of a class, which includes the maintainability, stability and understandability. See also
Bibliography
Posted by Manuel Pichler
in php, php_depend, phpugdo, planet-php, projects
at
11:59
| Comment (1)
| Trackbacks (0)
Defined tags for this entry: cbo, coupling between objects, php_depend, quality assurance, software metrics
Saturday, June 19. 2010PHP_Depend 0.9.16 bugfix releaseToday/Yesterday we have released the bugfix version 0.9.15 and 0.9.16 of PHP_Depend. With these releases we have closed a critical bug in PHP_Depend's handling of namespaces, where identical class names in two different namespaces resulted in an endless loop, so that the php process died with a fatal error.
As always, you can get the latest PHP_Depend version from its PEAR channel: pear.pdepend.org: mapi@arwen ~ $ pear channel-discover pear.pdepend.org mapi@arwen ~ $ pear install pdepend/PHP_Depend-beta Or you can fetch the sources from the subversion reposition: mapi@arwen ~ $ svn co http://svn.pdepend.org/trunk pdepend And additionally you can find a repository mirror on github: mapi@arwen ~ $ git clone git://github.com/manuelpichler/pdepend.git
Posted by Manuel Pichler
in php, php_depend, phpugdo, projects
at
13:07
| Comments (0)
| Trackbacks (0)
Thursday, June 10. 2010phpUnderControl 0.6.0beta2 releasedToday I have released the second beta version of phpUnderControl. Beside several minor tweaks and bug fixes, this release contains one additional feature I was asked for during the IPC in Berlin. This feature allows you to specify a maximum number of log entries that will be shown in the generated metric charts. This can be very useful once you have a project with a great amount of builds and the chart rendering gets slower and slower.
This feature adds a new option
mapi@arwen ~ $ phpuc --force-update --max-number 42 \
/opt/cruisecontrol/logs/phpUnderControl \
/opt/cruisecontrol/logs/phpUnderControl
You can get the latest release of phpUnderControl through its pear channel: mapi@arwen ~ $ pear upgrade --alldeps phpuc/phpUnderControl-0.6.0beta2 Starting to download phpUnderControl-0.6.0beta2.tgz (546,314 bytes) ................................................................... .............................done: 546,314 bytes or you can get the latest development version on github.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php, projects
at
12:25
| Comments (3)
| Trackbacks (0)
Defined tags for this entry: continuous integration, cruisecontrol, phpundercontrol, release announcement
Thursday, May 27. 2010Presenting the first Qafoo Service - Zeta ComponentsNow that the founding of the Qafoo - Passion for software quality company is announced, it is time to present the consulting services which we will provide around the quality lifecycle of PHP applications. The first series of services that we will provide is all around the high quality component library Zeta Components, formally known as eZ Components. The Zeta Components provide a loosely coupled set of unique and well thought out features, like the WebDAV server implementation, the Graph component which makes the generation of appealing charts very easy, or the widely used Mail component. Other aspects of the Zeta Components, which highlight our quality claim for the Qafoo GmbH, are the excessive documentation and the very high test coverage, which guarantees a consistently good product quality. Another key benefit of the Zeta Components are their loosely coupled structure, so that you can cherry pick some of the components and integrate them in your current application or framework infrastructure. Based on the profound knowledge of Toby and Kore, two core developers behind the components for last five years, we will offer professional trainings and support that is backed by a company. Furthermore we provide paid-development and customization of the components to your own special needs. Another point that speaks for the use of Zeta components is that the components are currently on their way to become an official project under the umbrella of the Apache Software Foundation, which guarantees a free use of the components, ensured by a stable legal basis. So if you would like to use the Zeta Components for your projects or you are interested in a custom training, send us a mail to contact@qafoo.com.
Posted by Manuel Pichler
in php, phpugdo, planet-php, Qafoo
at
10:56
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: apache software foundation, consulting, ezcomponents, kore, qafoo, toby, zeta components
Wednesday, May 12. 2010Artikel zum Thema SoftwaremetrikenThis blog post is in German as the mentioned article was published in German.
In der heute erschienenen Ausgabe 4.10 des PHP Magazins ist auch ein Artikel von mir enthalten, und wie sollte es wohl anders sein *Trommelwirbel*, beschäftigt der sich mit dem Thema Softwaremetriken Über Kommentare, Anregungen und Kritik rund um den Artikel würde ich mich sehr freuen. Und sollte euch der Artikel gefallen haben, empfehle ich die Internationale PHP Conference 2010, die vom 30. Mai bis 2. Juni in Berlin stattfindet, an der ich teilnehmen und zwei Vorträge halten werden.
Posted by Manuel Pichler
in php, php_depend, phpmd, phpugdo, phpundercontrol, projects, staticReflection
at
09:04
| Comments (0)
| Trackbacks (0)
PHP-Magazin Artikel zum Thema SoftwaremetrikenThis blog post is in German as the mentioned article was published in German.
In der heute erschienenen Ausgabe 4.10 des PHP Magazins ist auch ein Artikel von mir enthalten, und wie sollte es wohl anders sein *Trommelwirbel*, beschäftigt der sich mit dem Thema Softwaremetriken Über Kommentare, Anregungen und Kritik rund um den Artikel würde ich mich sehr freuen. Und sollte euch der Artikel gefallen haben, empfehle ich die Internationale PHP Conference 2010, die vom 30. Mai bis 2. Juni in Berlin stattfindet, an der ich teilnehmen und zwei Vorträge halten werden.
Posted by Manuel Pichler
in php, php_depend, phpmd, phpugdo, phpundercontrol, projects, staticReflection
at
09:04
| Comments (0)
| Trackbacks (0)
Monday, May 10. 2010PHP_Depend 0.9.13 bugfix releaseToday we have released the bugfix version 0.9.13 of PHP_Depend, the tool
to measure several software metrics for your PHP application. This release
fixes two critical bugs. One in the tokenizer implementation, which has
modified valid code under test in such a way, that it has become invalid
PHP code. The second fix is related to PHP_Depends's test code, where a
missing
As always, you can get the latest PHP_Depend version from its PEAR channel: pear.pdepend.org: mapi@arwen ~ $ pear channel-discover pear.pdepend.org mapi@arwen ~ $ pear install pdepend/PHP_Depend-beta Or you can fetch the sources from the subversion reposition: mapi@arwen ~ $ svn co http://svn.pdepend.org/trunk pdepend And additionally you can find a repository mirror on github: mapi@arwen ~ $ git clone git://github.com/manuelpichler/pdepend.git
Posted by Manuel Pichler
in php, php_depend, phpugdo, projects
at
17:31
| Comments (0)
| Trackbacks (0)
Thursday, April 29. 2010Goodbye CologneAs many of you may already have noticed, there will be a big change in my career as a professional software engineer and architect this summer. Together with Kore and Toby I am in the process of founding a company. The focus of this company will be on services all around the whole quality life cycle in PHP projects. Under the hood of our company we will also offer support, trainings and consulting for several quality assurance tools, like pdepend, phpmd and phpUnderControl. For you, this opens a great opportunity. You can use the tools and the documentation, as well as participate in the community, as usual. But from now on you can also purchase professional support, if you get stuck or need general assitance. And when you miss a feature or need an individual extension for one of these tools, don't hesitate to contact us. I am really excited what cool things will happen in the next couple of years and I am looking forward to cowork with professionals like Toby and Kore. To finalize the little marketing for the company and its services
Posted by Manuel Pichler
in php, php_depend, phpmd, phpugdo, phpundercontrol, planet-php
at
13:20
| Comments (3)
| Trackbacks (0)
Defined tags for this entry: changes, company, consulting, php, phpmd, phpundercontrol, php_depend, quality, support, training
Sunday, April 25. 2010PHP_Depend 0.9.12 releaseI am proud to announce the 0.9.12 release of PHP_Depend. PHP_Depend is a low level static code analysis tool. It takes the given source and calculates several software metrics for the code. This data can be used by software-developers, architects and designers to control the quality of a software-product without time consuming code audits. This new release of PHP_Depend has done a great step into the direction of a token free PHP_Depend version. This means future versions of PHP_Depend will work without the need to traverse linear token streams up and down, to measure metrics. Instead PHP_Depend will rely on it's internal abstract syntax tree, that represents the logical structure of the analyzed source code. With this solution it will be possible to implement several new features that will make PHP_Depend more useful, for example static callgraph analysis.
As always, you can get the latest PHP_Depend version from its PEAR channel: pear.pdepend.org: mapi@arwen ~ $ pear channel-discover pear.pdepend.org mapi@arwen ~ $ pear install pdepend/PHP_Depend-beta Or you can fetch the sources from the subversion reposition: mapi@arwen ~ $ svn co http://svn.pdepend.org/trunk pdepend And additionally you can find a repository mirror on github: mapi@arwen ~ $ git clone git://github.com/manuelpichler/pdepend.git
Posted by Manuel Pichler
in php, php_depend, phpugdo, projects
at
14:44
| Comments (0)
| Trackbacks (0)
Thursday, April 8. 2010Howto create custom rule sets for PHPMDIn this blog post I will describe a useful feature in PHPMD that will simplify your life when it comes to create custom rule sets for PHPMD. PHPMD can be seen as an one level down/low level equivalent to PHP_CodeSniffer. It is a simple command line tool that can be used to check your application's source code for possible bugs, suboptimal or overcomplicated code. The current release of PHPMD ships with three default rule sets. The first set of rules tests the codesize of class, methods and functions. The second rule set contains rules that check your code for unused variables, methods etc. and finally there is a rule set that tests the code against some naming conventions. Normally when you start using a quality assurance tool, you will not want to use it's default configuration. Sometimes you would like to use only a subset, because the full stack will produce too much noise, or you would like to customize some thresholds, because the factory defaults do not fit to your environment. In this blog post I give a short introduction into PHPMD's rule set syntax and howto to create your own rule set, by reusing parts of the existing default configuration. If you would like to only pick some of the rules that come with PHPMD and you want to customize some of the predefined thresholds, you can do this by creating your own rule set file that references a custom collection of rules with an individual configuration. Starting with an empty ruleset.xml fileThe simpliest way to start with a new rule set is to copy one of the
existing files and remove all the rule-tags from the document body.
Otherwise you can use the following example as a template for your own
rule set file. You should change the content of the
<?xml version="1.0"?>
<ruleset name="My first PHPMD rule set"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0
http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="
http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
My custom rule set that checks my code...
</description>
</ruleset>
Adding rule references to the new ruleset.xml fileThe first thing we would like to do is to add all unused code rules
to the new rule set file. This can simply be done with a
<?xml version="1.0"?>
<ruleset name="My first PHPMD rule set"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0
http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="
http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
My custom rule set that checks my code...
</description>
<!-- Import the entire unused code rule set -->
<rule ref="rulesets/unusedcode.xml" />
</ruleset>
That's it. Now the custom rule set applies all unused code rules against the analyzed source code. We would also like to use the cyclomatic complexity rule from the
existing codesize set in our custom rule set. To achieve this we can
reuse the same syntax with a
<?xml version="1.0"?>
<ruleset name="My first PHPMD rule set"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0
http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="
http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
My custom rule set that checks my code...
</description>
<!-- Import the entire unused code rule set -->
<rule ref="rulesets/unusedcode.xml" />
<!-- Import the entire cyclomatic complexity rule -->
<rule ref="rulesets/codesize.xml/CyclomaticComplexity" />
</ruleset>
Now that the new rule set uses the cyclomatic complexity rule we would
also like to customize some of the rule's properties. First we will
increase the rule's priority to the highest possible priority value
<?xml version="1.0"?>
<ruleset name="My first PHPMD rule set"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0
http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="
http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
My custom rule set that checks my code...
</description>
<!-- Import the entire unused code rule set -->
<rule ref="rulesets/unusedcode.xml" />
<!--
Import the entire cyclomatic complexity rule and
customize the rule configuration.
-->
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
<priority>1</priority>
<properties>
<property name="reportLevel" value="5" />
</properties>
</rule>
</ruleset>
You should know that PHPMD handles all custom settings additive. This means that PHPMD keeps the original configuration for every setting that isn't customized in a rule reference. Excluding rules from a rule setFinally we would like to reuse the naming rule set of PHPMD. But we
don't like the two variable naming rules, so that we must exclude them
from out rule set file. This exclusion can be achieved by declaring an
<?xml version="1.0"?>
<ruleset name="My first PHPMD rule set"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0
http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="
http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
My custom rule set that checks my code...
</description>
<!-- Import the entire unused code rule set -->
<rule ref="rulesets/unusedcode.xml" />
<!--
Import the entire cyclomatic complexity rule and
customize the rule configuration.
-->
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
<priority>1</priority>
<properties>
<property name="reportLevel" value="5" />
</properties>
</rule>
<!-- Import entire naming rule set and exclude rules -->
<rule ref="rulesets/naming.xml">
<exclude name="ShortVariable" />
<exclude name="LongVariable" />
</rule>
</ruleset>
ConclusionWith PHPMD's rule set syntax it is possible to customize all aspects of rules for your own needs and you can reuse every existing rule set xml file in your own set. You should take a look at PHPMD's rule documentation if it happens that you don't know what rules exist or you don't know exactly, which settings are available for one rule, while you create your own set of rules. Another good source of information are the rule set files that are shipped with PHPMD. You can get the latest PHPMD version from its PEAR channel: pear.phpmd.org mapi@arwen ~ $ pear channel-discover pear.pdepend.org mapi@arwen ~ $ pear channel-discover pear.phpmd.org mapi@arwen ~ $ pear install --alldeps phpmd/PHP_PMD-alpha Or from our github repository: mapi@arwen ~ $ git clone git://github.com/manuelpichler/phpmd.git I would be glad if you file a ticket in PHPMD's issue tracker for all issues and/or enhancements you encounter while testing PHPMD.
Posted by Manuel Pichler
in php, phpmd, phpugdo, planet-php, projects
at
14:25
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: annotations, customization, phpmd, quality assurance, rule set, static code analysis
Thursday, March 4. 2010PHPMD 0.2.3 released with @SuppressWarnings support and new rule set.We are proud to announce the 0.2.3 release of the PHP Mess Detector, a tool that takes source code and performs various tests to calculate various quality aspects from it. The measured values are a good starting point for future improvements. This release contains some new features, for example support for the @SuppressWarnings annotation, that allows you to exclude single methods or complete classes from PHPMD's analyzing process. This annotation can be used to suppress a single rule, a group of rules or PHPMD at all.
/**
* Suppress all PHPMD warnings for this class.
*
* @SuppressWarnings(PHPMD)
*/
class PHPMD_SuppressAll
{
}
class PHPMD_SuppressOnMethod
{
/**
* Do not warn about the unused parameter $bar.
*
* @SuppressWarnings(PHPMD.UnusedFormatParameter)
*/
public function foo($bar)
{
}
}
Beside several bugfixes this release comes with a new set of rules that check the naming of methods, variables etc. against common coding conventions and best practices.
You can get the latest PHPMD version from its PEAR channel: pear.phpmd.org mapi@arwen ~ $ pear channel-discover pear.pdepend.org mapi@arwen ~ $ pear channel-discover pear.phpmd.org mapi@arwen ~ $ pear install --alldeps phpmd/PHP_PMD-alpha Or from our github repository: mapi@arwen ~ $ git clone git://github.com/manuelpichler/phpmd.git
Posted by Manuel Pichler
in php, phpmd, phpugdo, projects
at
10:32
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: annotations, phpmd, quality assurance, release announcement, static code analysis
Tuesday, March 2. 2010PHP_Depend-0.9.11 releasedI have just released version 0.9.11 of PHP_Depend. It contains a few bug fixes and improvements for PHP_Depend.
As always, you can get the latest PHP_Depend version from its PEAR channel: pear.pdepend.org: mapi@arwen ~ $ pear channel-discover pear.pdepend.org mapi@arwen ~ $ pear install pdepend/PHP_Depend-beta Or you can fetch the sources from the subversion reposition: mapi@arwen ~ $ svn co http://svn.pdepend.org/branches/0.9.0/ And additionally you can find a repository mirror on github: mapi@arwen ~ $ git clone git://github.com/manuelpichler/pdepend.git
Posted by Manuel Pichler
in php, php_depend, phpugdo, projects
at
21:08
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: bug fix, php_depend, release announcement, software metrics, static code analysis
Tuesday, February 23. 2010PHP_Depend-0.9.10 releasedI have just released the bug fix version 0.9.10 of PHP_Depend. This release contains several bug fixes and improvements for PHP_Depend.
As always, you can get the latest PHP_Depend version from its PEAR channel: pear.pdepend.org: mapi@arwen ~ $ pear channel-discover pear.pdepend.org mapi@arwen ~ $ pear install pdepend/PHP_Depend-beta Or you can fetch the sources from the subversion reposition: mapi@arwen ~ $ svn co http://svn.pdepend.org/branches/0.9.0/ And additionally you can find a repository mirror on github: mapi@arwen ~ $ git clone git://github.com/manuelpichler/pdepend.git
Posted by Manuel Pichler
in php, php_depend, phpugdo, planet-php, projects
at
20:36
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: php, php5, php_depend, quality assurance, release announcement, software metrics, static code analysis
Thursday, February 4. 2010Talk about "Software Metrics" at PHPUG CologneThis friday I will give my software metrics introduction talk at the PHP User Group Cologne. The talk covers several aspects of static code analysis. Starting with classic count and complexity metrics, up to modern metrics, which are used for tracking the dependencies and coupling in a modern OO-systems.
I hope this talk will inspire some of the listerners, how software metrics can be used to improve the quality of their software projects. The talk will take place at:
Looking forward to meet you there.
(Page 1 of 6, totaling 77 entries)
» next page
|
ProjectsFurther stuffCategories |

