diff --git a/CHANGELOG b/CHANGELOG index 3f75006..4228621 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +phpUnderControl 0.6.1 +--------------------- + +- New setup command, which creates an unix init script for your phpUnderControl + installation. All features were supplied by proofek. + phpUnderControl 0.6.0 --------------------- diff --git a/data/webapps/cruisecontrol/main.jsp b/data/webapps/cruisecontrol/main.jsp index d8ae511..b605bf1 100644 --- a/data/webapps/cruisecontrol/main.jsp +++ b/data/webapps/cruisecontrol/main.jsp @@ -138,13 +138,13 @@ <%-- phpUnderControl 8 --%> - - <%@ include file="phpunit-pmd.jsp" %> + + <%@ include file="phpmd.jsp" %> <%-- phpUnderControl 9 --%> - <%@ include file="phpunit-cpd.jsp" %> + <%@ include file="php-cpd.jsp" %> <%-- phpUnderControl 10 --%> diff --git a/data/webapps/cruisecontrol/metrics.cewolf.jsp b/data/webapps/cruisecontrol/metrics.cewolf.jsp index 3ac7e0f..c2da362 100644 --- a/data/webapps/cruisecontrol/metrics.cewolf.jsp +++ b/data/webapps/cruisecontrol/metrics.cewolf.jsp @@ -114,7 +114,7 @@ Displays the number of broken and successful builds <% xpathData.add("PHP CodeSniffer", "count(/cruisecontrol/checkstyle/file/error)"); - xpathData.add("PHPUnit PMD", "count(/cruisecontrol/pmd/file/violation)"); + xpathData.add("PHPMD", "count(/cruisecontrol/pmd/file/violation)"); xpathData.add("PHPdoc", "count(/cruisecontrol/build//target[@name='php-documentor']/task[@name='exec']/message[contains(text(), 'WARNING in') or contains(text(), 'WARNING:') or contains(text(), 'ERROR in') or contains(text(), 'ERROR:')])"); %> @@ -125,4 +125,4 @@ Displays the number of broken and successful builds - \ No newline at end of file + diff --git a/data/webapps/cruisecontrol/phpunit-cpd.jsp b/data/webapps/cruisecontrol/php-cpd.jsp similarity index 94% rename from data/webapps/cruisecontrol/phpunit-cpd.jsp rename to data/webapps/cruisecontrol/php-cpd.jsp index f0ce802..ff58f1d 100644 --- a/data/webapps/cruisecontrol/phpunit-cpd.jsp +++ b/data/webapps/cruisecontrol/php-cpd.jsp @@ -37,6 +37,6 @@ <%@page errorPage="/error.jsp"%> <%@ taglib uri="/WEB-INF/cruisecontrol-jsp11.tld" prefix="cruisecontrol"%> - + diff --git a/data/webapps/cruisecontrol/phpunit-pmd.jsp b/data/webapps/cruisecontrol/phpmd.jsp similarity index 94% rename from data/webapps/cruisecontrol/phpunit-pmd.jsp rename to data/webapps/cruisecontrol/phpmd.jsp index ce1ead4..5e4f8e2 100644 --- a/data/webapps/cruisecontrol/phpunit-pmd.jsp +++ b/data/webapps/cruisecontrol/phpmd.jsp @@ -37,6 +37,6 @@ <%@page errorPage="/error.jsp"%> <%@ taglib uri="/WEB-INF/cruisecontrol-jsp11.tld" prefix="cruisecontrol"%> - + diff --git a/data/webapps/cruisecontrol/xsl/buildresults.xsl b/data/webapps/cruisecontrol/xsl/buildresults.xsl index d0d981f..ae2227c 100644 --- a/data/webapps/cruisecontrol/xsl/buildresults.xsl +++ b/data/webapps/cruisecontrol/xsl/buildresults.xsl @@ -38,7 +38,7 @@ - + diff --git a/data/webapps/cruisecontrol/xsl/phpunit-cpd-details.xsl b/data/webapps/cruisecontrol/xsl/php-cpd-details.xsl similarity index 97% rename from data/webapps/cruisecontrol/xsl/phpunit-cpd-details.xsl rename to data/webapps/cruisecontrol/xsl/php-cpd-details.xsl index a2af091..8d485da 100644 --- a/data/webapps/cruisecontrol/xsl/phpunit-cpd-details.xsl +++ b/data/webapps/cruisecontrol/xsl/php-cpd-details.xsl @@ -43,7 +43,7 @@ - + @@ -61,7 +61,7 @@ -

PHPUnit CPD

+

PHP-CPD

@@ -109,4 +109,4 @@
-
\ No newline at end of file + diff --git a/data/webapps/cruisecontrol/xsl/phpunit-pmd-details.xsl b/data/webapps/cruisecontrol/xsl/phpmd-details.xsl similarity index 92% rename from data/webapps/cruisecontrol/xsl/phpunit-pmd-details.xsl rename to data/webapps/cruisecontrol/xsl/phpmd-details.xsl index 266ecfd..73a12b1 100644 --- a/data/webapps/cruisecontrol/xsl/phpunit-pmd-details.xsl +++ b/data/webapps/cruisecontrol/xsl/phpmd-details.xsl @@ -45,14 +45,14 @@ - - + + -

PHPUnit PMD

+

PHPMD

- + @@ -63,12 +63,16 @@ - + + +
+ + @@ -76,14 +80,18 @@ -
+ + +
+ + () - Priority + Priority @@ -160,4 +168,4 @@
- \ No newline at end of file + diff --git a/data/webapps/cruisecontrol/xsl/phpunit-pmd-list.xsl b/data/webapps/cruisecontrol/xsl/phpmd-list.xsl similarity index 95% rename from data/webapps/cruisecontrol/xsl/phpunit-pmd-list.xsl rename to data/webapps/cruisecontrol/xsl/phpmd-list.xsl index 3119159..ba9d99c 100644 --- a/data/webapps/cruisecontrol/xsl/phpunit-pmd-list.xsl +++ b/data/webapps/cruisecontrol/xsl/phpmd-list.xsl @@ -42,7 +42,7 @@ - +

@@ -52,13 +52,13 @@ - + - + @@ -99,4 +99,4 @@
PHPUnit PMD Violations in FilesPHPMD Violations in Files Errors / Warnings
- \ No newline at end of file + diff --git a/data/webapps/cruisecontrol/xsl/phpunit-pmd-summary.xsl b/data/webapps/cruisecontrol/xsl/phpmd-summary.xsl similarity index 96% rename from data/webapps/cruisecontrol/xsl/phpunit-pmd-summary.xsl rename to data/webapps/cruisecontrol/xsl/phpmd-summary.xsl index 8a4b14d..2bc9ee7 100644 --- a/data/webapps/cruisecontrol/xsl/phpunit-pmd-summary.xsl +++ b/data/webapps/cruisecontrol/xsl/phpmd-summary.xsl @@ -51,7 +51,7 @@ - PHPUnit PMD rule + PHPMD rule Files Errors / Warnings @@ -73,7 +73,7 @@ - PHPUnit PMD + PHPMD / @@ -88,7 +88,7 @@ oddrow - PHPUnit CPD / CopyPasteDetection + PHP-CPD / CopyPasteDetection @@ -104,4 +104,4 @@ - \ No newline at end of file + diff --git a/data/webapps/cruisecontrol/xsl/phpunit-pmd.xsl b/data/webapps/cruisecontrol/xsl/phpmd.xsl similarity index 97% rename from data/webapps/cruisecontrol/xsl/phpunit-pmd.xsl rename to data/webapps/cruisecontrol/xsl/phpmd.xsl index 9c8b657..8c677cf 100644 --- a/data/webapps/cruisecontrol/xsl/phpunit-pmd.xsl +++ b/data/webapps/cruisecontrol/xsl/phpmd.xsl @@ -38,7 +38,7 @@ - + diff --git a/package.xml b/package.xml index 5ddd0f5..468c0e2 100644 --- a/package.xml +++ b/package.xml @@ -1608,12 +1608,12 @@ example project. - + - - - - + + + +

@@ -1656,10 +1656,10 @@ example project. - + - + diff --git a/src/Commands/InstallCommand.php b/src/Commands/InstallCommand.php index 686a9ef..f0e12d2 100644 --- a/src/Commands/InstallCommand.php +++ b/src/Commands/InstallCommand.php @@ -74,8 +74,8 @@ class phpucInstallCommand extends phpucAbstractCommand implements phpucConsoleCo '/webapps/cruisecontrol/metrics.cewolf.jsp', '/webapps/cruisecontrol/phpcs.jsp', '/webapps/cruisecontrol/phpunit.jsp', - '/webapps/cruisecontrol/phpunit-pmd.jsp', - '/webapps/cruisecontrol/phpunit-cpd.jsp', + '/webapps/cruisecontrol/phpmd.jsp', + '/webapps/cruisecontrol/php-cpd.jsp', '/webapps/cruisecontrol/servertime.jsp', '/webapps/cruisecontrol/css/php-under-control.css', '/webapps/cruisecontrol/css/SyntaxHighlighter.css', @@ -113,12 +113,12 @@ class phpucInstallCommand extends phpucAbstractCommand implements phpucConsoleCo '/webapps/cruisecontrol/xsl/phpdoc.xsl', '/webapps/cruisecontrol/xsl/phphelper.xsl', '/webapps/cruisecontrol/xsl/phpunit.xsl', - '/webapps/cruisecontrol/xsl/phpunit-cpd-details.xsl', + '/webapps/cruisecontrol/xsl/php-cpd-details.xsl', '/webapps/cruisecontrol/xsl/phpunit-details.xsl', - '/webapps/cruisecontrol/xsl/phpunit-pmd.xsl', - '/webapps/cruisecontrol/xsl/phpunit-pmd-details.xsl', - '/webapps/cruisecontrol/xsl/phpunit-pmd-list.xsl', - '/webapps/cruisecontrol/xsl/phpunit-pmd-summary.xsl', + '/webapps/cruisecontrol/xsl/phpmd.xsl', + '/webapps/cruisecontrol/xsl/phpmd-details.xsl', + '/webapps/cruisecontrol/xsl/phpmd-list.xsl', + '/webapps/cruisecontrol/xsl/phpmd-summary.xsl', '/webapps/cruisecontrol/WEB-INF/lib/php-under-control.jar', ); diff --git a/src/Console/ConsoleInput.php b/src/Console/ConsoleInput.php index 338b678..4fa790b 100644 --- a/src/Console/ConsoleInput.php +++ b/src/Console/ConsoleInput.php @@ -527,6 +527,7 @@ private function tokenizeHelp( $help ) * @param array(string=>mixed) $option2 Compare option two. * * @return integer + * @SuppressWarnings(PHPMD.UnusedPrivateMethod) */ private function sortCommandOptions( $option1, $option2 ) { diff --git a/src/Graph/GraphPalette.php b/src/Graph/GraphPalette.php index 8b193ff..4e3be8e 100644 --- a/src/Graph/GraphPalette.php +++ b/src/Graph/GraphPalette.php @@ -1,7 +1,7 @@ . @@ -35,7 +35,7 @@ * 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. - * + * * @category QualityAssurance * @package Graph * @author Manuel Pichler @@ -66,12 +66,26 @@ class phpucGraphPalette extends ezcGraphPaletteEzGreen protected $background = '#eeeeef'; /** - * Light gray grid lines. + * Axiscolor * - * @var string + * @var ezcGraphColor + */ + protected $axisColor = '#2E3436'; + + /** + * Color of grid lines + * + * @var ezcGraphColor */ - protected $majorGridColor = '#d3d7cf'; - + protected $majorGridColor = '#2E3436B0'; + + /** + * Color of minor grid lines + * + * @var ezcGraphColor + */ + protected $minorGridColor = '#2E3436E0'; + /** * Four gray and green tango colors for different graph records. * @@ -80,9 +94,13 @@ class phpucGraphPalette extends ezcGraphPaletteEzGreen protected $dataSetColor = array( '#8ae234', '#f57900', - '#437610', - '#888a85', - '#2e3436', + '#3465A4', + '#CC0000', + '#EDD400', + '#75505B', + '#F57900', + '#204A87', + '#C17D11', ); /** @@ -91,7 +109,7 @@ class phpucGraphPalette extends ezcGraphPaletteEzGreen * @var array(integer) */ protected $dataSetSymbol = array( - ezcGraph::NO_SYMBOL, + ezcGraph::BULLET, ); /** @@ -107,4 +125,48 @@ class phpucGraphPalette extends ezcGraphPaletteEzGreen * @var string */ protected $fontColor = '#555753'; + + + /** + * Backgroundcolor for chart + * + * @var ezcGraphColor + */ + protected $chartBackground = '#FFFFFFFF'; + + /** + * Padding in elements + * + * @var integer + */ + protected $padding = 1; + + /** + * Margin of elements + * + * @var integer + */ + protected $margin = 1; + + /** + * Backgroundcolor for elements + * + * @var ezcGraphColor + */ + protected $elementBackground = '#FFFFFFB0'; + + /** + * Bordercolor for elements + * + * @var ezcGraphColor + */ + protected $elementBorderColor = '#FFFFFF'; + + /** + * Borderwidth for elements + * + * @var integer + * @access protected + */ + protected $elementBorderWidth = 1; } \ No newline at end of file diff --git a/src/Graph/Input/CodeClassesInput.php b/src/Graph/Input/CodeClassesInput.php new file mode 100644 index 0000000..f98cb9c --- /dev/null +++ b/src/Graph/Input/CodeClassesInput.php @@ -0,0 +1,93 @@ +. + * 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. + * + * @category QualityAssurance + * @package Graph + * @subpackage Input + * @author Manuel Pichler + * @copyright 2007-2010 Manuel Pichler. All rights reserved. + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version SVN: $Id$ + * @link http://www.phpundercontrol.org/ + */ + +/** + * This input provides data for the Number-of-Classes-Graph. + * + * @category QualityAssurance + * @package Graph + * @subpackage Input + * @author Hans-Peter Buniat + * @copyright 2007-2010 Manuel Pichler. All rights reserved. + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://www.phpundercontrol.org/ + */ +class phpucCodeClassesInput extends phpucAbstractInput +{ + /** + * Constructs a Number of Classes input instance. + */ + public function __construct() + { + parent::__construct( + 'Number of Classes', + '08-number-of-classes', + phpucChartI::TYPE_LINE + ); + + $this->yAxisLabel = 'Classes'; + $this->xAxisLabel = 'Build '; + + $this->addRule( + new phpucInputRule( + 'Number of Classes', + '/cruisecontrol/metrics/@noc', + self::MODE_VALUE + ) + ); + + $this->addRule( + new phpucInputRule( + 'Number of Interfaces', + '/cruisecontrol/metrics/@noi', + self::MODE_VALUE + ) + ); + } +} diff --git a/src/Graph/Input/CodeCopyPasteInput.php b/src/Graph/Input/CodeCopyPasteInput.php index 03e47a7..64c80ca 100644 --- a/src/Graph/Input/CodeCopyPasteInput.php +++ b/src/Graph/Input/CodeCopyPasteInput.php @@ -1,7 +1,7 @@ . @@ -35,7 +35,7 @@ * 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. - * + * * @category QualityAssurance * @package Graph * @subpackage Input @@ -66,14 +66,14 @@ class phpucCodeCopyPasteInput extends phpucAbstractInput public function __construct() { parent::__construct( - 'Duplicated Code', - '09-duplicate-code', + 'Duplicated Code', + '06-duplicate-code', phpucChartI::TYPE_LINE ); - + $this->yAxisLabel = 'Duplications'; $this->xAxisLabel = 'Build '; - + $this->addRule( new phpucInputRule( 'Lines', diff --git a/src/Graph/Input/CodeLinesCommentsInput.php b/src/Graph/Input/CodeLinesCommentsInput.php new file mode 100644 index 0000000..dc9a375 --- /dev/null +++ b/src/Graph/Input/CodeLinesCommentsInput.php @@ -0,0 +1,93 @@ +. + * 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. + * + * @category QualityAssurance + * @package Graph + * @subpackage Input + * @author Manuel Pichler + * @copyright 2007-2010 Manuel Pichler. All rights reserved. + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version SVN: $Id$ + * @link http://www.phpundercontrol.org/ + */ + +/** + * This input provides data for the Code-Lines/Comments-Graph. + * + * @category QualityAssurance + * @package Graph + * @subpackage Input + * @author Hans-Peter Buniat + * @copyright 2007-2010 Manuel Pichler. All rights reserved. + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://www.phpundercontrol.org/ + */ +class phpucCodeLinesCommentsInput extends phpucAbstractInput +{ + + /** + * Constructs a LOC/CLOC input instance. + */ + public function __construct() + { + parent::__construct( + 'Lines of Code', + '07-lines-of-code', + phpucChartI::TYPE_LINE + ); + + $this->yAxisLabel = 'Lines'; + $this->xAxisLabel = 'Build '; + + $this->addRule( + new phpucInputRule( + 'Lines of Code', + '/cruisecontrol/metrics/@loc', + self::MODE_VALUE + ) + ); + $this->addRule( + new phpucInputRule( + 'Comments', + '/cruisecontrol/metrics/@cloc', + self::MODE_VALUE + ) + ); + } +} diff --git a/src/Graph/Input/CodeViolationInput.php b/src/Graph/Input/CodeViolationInput.php index be39882..62a1f3e 100644 --- a/src/Graph/Input/CodeViolationInput.php +++ b/src/Graph/Input/CodeViolationInput.php @@ -1,7 +1,7 @@ . @@ -35,7 +35,7 @@ * 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. - * + * * @category QualityAssurance * @package Graph * @subpackage Input @@ -67,13 +67,13 @@ public function __construct() { parent::__construct( 'Coding Violations', - '07-coding-violations', + '05-coding-violations', phpucChartI::TYPE_LINE ); - + $this->yAxisLabel = 'Violations'; $this->xAxisLabel = 'Build '; - + $this->addRule( new phpucInputRule( 'PHP CodeSniffer', @@ -96,9 +96,9 @@ public function __construct() ]/task[ @name="exec" ]/message[ - contains(text(), "WARNING in") or - contains(text(), "WARNING:") or - contains(text(), "ERROR in") or + contains(text(), "WARNING in") or + contains(text(), "WARNING:") or + contains(text(), "ERROR in") or contains(text(), "ERROR:") ]', self::MODE_COUNT diff --git a/src/Graph/Input/InputRule.php b/src/Graph/Input/InputRule.php index e8b95a7..0bf7659 100644 --- a/src/Graph/Input/InputRule.php +++ b/src/Graph/Input/InputRule.php @@ -90,7 +90,7 @@ class phpucInputRule phpucInputI::MODE_COUNT, phpucInputI::MODE_SUM, phpucInputI::MODE_VALUE, - phpucInputI::MODE_LIST, + phpucInputI::MODE_LIST ); /** diff --git a/src/Graph/Input/TestCodeRatioInput.php b/src/Graph/Input/TestCodeRatioInput.php index 0e0e8ff..a20d571 100644 --- a/src/Graph/Input/TestCodeRatioInput.php +++ b/src/Graph/Input/TestCodeRatioInput.php @@ -1,7 +1,7 @@ . @@ -35,7 +35,7 @@ * 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. - * + * * @category QualityAssurance * @package Graph * @subpackage Input @@ -65,15 +65,15 @@ class phpucTestCodeRatioInput extends phpucAbstractInput */ public function __construct() { - parent::__construct( - 'Test to Code Ratio', - '06-test-to-code-ratio', - phpucChartI::TYPE_LINE + parent::__construct( + 'Test to Code Ratio', + '12-test-to-code-ratio', + phpucChartI::TYPE_LINE ); - + $this->yAxisLabel = 'Classes / Methods'; $this->xAxisLabel = 'Build '; - + $this->addRule( new phpucInputRule( 'Classes', @@ -92,7 +92,7 @@ public function __construct() new phpucInputRule( 'Test Classes', '/cruisecontrol/testsuites//testsuite[testcase]', - self::MODE_COUNT + self::MODE_COUNT ) ); $this->addRule( diff --git a/src/Graph/Input/UnitCoverageInput.php b/src/Graph/Input/UnitCoverageInput.php index cc0587d..8b3b50d 100644 --- a/src/Graph/Input/UnitCoverageInput.php +++ b/src/Graph/Input/UnitCoverageInput.php @@ -1,7 +1,7 @@ . @@ -35,7 +35,7 @@ * 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. - * + * * @category QualityAssurance * @package Graph * @subpackage Input @@ -65,12 +65,12 @@ class phpucUnitCoverageInput extends phpucAbstractInput */ public function __construct() { - parent::__construct( - 'Unit Coverage', - '04-unit-coverage', + parent::__construct( + 'Executable Lines of Code', + '06-executable-lines-coverage', phpucChartI::TYPE_LINE ); - + $this->yAxisLabel = 'Lines'; $this->xAxisLabel = 'Build '; diff --git a/src/Graph/Input/UnitCoveragePercentInput.php b/src/Graph/Input/UnitCoveragePercentInput.php new file mode 100644 index 0000000..3c70d4a --- /dev/null +++ b/src/Graph/Input/UnitCoveragePercentInput.php @@ -0,0 +1,86 @@ +. + * 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. + * + * @category QualityAssurance + * @package Graph + * @subpackage Input + * @author Manuel Pichler + * @copyright 2007-2010 Manuel Pichler. All rights reserved. + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version SVN: $Id$ + * @link http://www.phpundercontrol.org/ + */ + +/** + * This input provides data for the Code-Coverage (Percent)-Graph. + * + * @category QualityAssurance + * @package Graph + * @subpackage Input + * @author Hans-Peter Buniat + * @copyright 2007-2010 Manuel Pichler. All rights reserved. + * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @version Release: @package_version@ + * @link http://www.phpundercontrol.org/ + */ +class phpucUnitCoveragePercentInput extends phpucAbstractInput +{ + + /** + * Constructs a Code-Coverage input instance. + */ + public function __construct() + { + parent::__construct( + 'Code Coverage', + '04-code-coverage', + phpucChartI::TYPE_LINE + ); + + $this->yAxisLabel = 'Percentage'; + $this->xAxisLabel = 'Build'; + + $this->addRule( + new phpucInputRule( + 'Coverage', + '/cruisecontrol/metrics/@eloc div /cruisecontrol/coverage/project/file/line[@count != 0]', + self::MODE_VALUE + ) + ); + } +} diff --git a/src/Graph/Input/UnitTestExecutionTimeInput.php b/src/Graph/Input/UnitTestExecutionTimeInput.php index b96dd04..e47e4f3 100644 --- a/src/Graph/Input/UnitTestExecutionTimeInput.php +++ b/src/Graph/Input/UnitTestExecutionTimeInput.php @@ -1,7 +1,7 @@ . @@ -35,7 +35,7 @@ * 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. - * + * * @category QualityAssurance * @package Graph * @subpackage Input @@ -66,11 +66,11 @@ class phpucUnitTestExecutionTimeInput extends phpucAbstractInput public function __construct() { parent::__construct( - 'Test Execution Time', - '08-test-execution-time', + 'Test Execution Time', + '11-test-execution-time', phpucChartI::TYPE_TIME ); - + $this->addRule( new phpucInputRule( 'execution-time', @@ -79,12 +79,12 @@ public function __construct() ) ); } - + /** * Counts te good and broken builds and extracts the day time. * * @param array(string=>array) $logs Fetched log data. - * + * * @return array(string=>array) */ protected function postProcessLog( array $logs ) diff --git a/src/Graph/Input/UnitTestInput.php b/src/Graph/Input/UnitTestInput.php index 5af076e..094c3cb 100644 --- a/src/Graph/Input/UnitTestInput.php +++ b/src/Graph/Input/UnitTestInput.php @@ -1,7 +1,7 @@ . @@ -35,7 +35,7 @@ * 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. - * + * * @category QualityAssurance * @package Graph * @subpackage Input @@ -65,15 +65,15 @@ class phpucUnitTestInput extends phpucAbstractInput */ public function __construct() { - parent::__construct( - 'Unit Tests', - '05-unit-tests', - phpucChartI::TYPE_LINE + parent::__construct( + 'Unit Tests', + '10-unit-tests', + phpucChartI::TYPE_LINE ); - + $this->yAxisLabel = 'Tests'; $this->xAxisLabel = 'Build '; - + $this->addRule( new phpucInputRule( 'Total', diff --git a/src/Graph/LineChart.php b/src/Graph/LineChart.php index a31c642..e16ebd6 100644 --- a/src/Graph/LineChart.php +++ b/src/Graph/LineChart.php @@ -65,7 +65,7 @@ class phpucLineChart extends ezcGraphLineChart implements phpucChartI * * @var boolean */ - protected $showSymbol = false; + protected $showSymbol = true; private $numberOfEntries = 0; @@ -113,22 +113,13 @@ public function setInput( phpucAbstractInput $input ) $value = $this->reduceNumberOfEntriesIfRequired( $value ); $this->data[$label] = new ezcGraphArrayDataSet( $value ); - $this->data[$label]->symbol = ezcGraph::BULLET; - if ( $this->showSymbol === true ) - { - continue; - } - - foreach ( array_keys( $value ) as $key ) - { - $this->data[$label]->symbol[$key] = ezcGraph::NO_SYMBOL; - } + $this->data[$label]->symbol = ( $this->showSymbol === true ) ? ezcGraph::BULLET : ezcGraph::NO_SYMBOL; } } /** - * This method will reduce the number of log entries + * This method will reduce the number of log entries * * @param array(mixed=>integer) $entries The raw input list of entries. * @@ -172,12 +163,20 @@ private function reduceNumberOfEntries( array $entries ) protected function init() { $this->palette = new phpucGraphPalette(); + $this->renderer = new ezcGraphRenderer2d(); + + // More beautiful formatting for legend + $this->renderer->options->dataBorder = 0; + $this->renderer->options->legendSymbolGleam = .3; + $this->renderer->options->legendSymbolGleamSize = .9; + $this->renderer->options->legendSymbolGleamColor = '#FFFFFF'; - $this->renderer->options->legendSymbolGleam = .3; + $this->renderer->options->shortAxis = true; + $this->renderer->options->axisEndStyle = ezcGraph::NO_SYMBOL; $this->options->symbolSize = 1; $this->options->lineThickness = 1; - $this->options->fillLines = 220; + $this->options->fillLines = 230; $this->initAxis(); $this->initTitle(); diff --git a/src/PhpUnderControl.php b/src/PhpUnderControl.php index f090bb5..bd042a2 100644 --- a/src/PhpUnderControl.php +++ b/src/PhpUnderControl.php @@ -107,13 +107,6 @@ public static function main() */ private $input = null; - /** - * List with all tasks. - * - * @var array(phpucTaskI) - */ - private $tasks = array(); - /** * The ctor creates the required console arg instance. */ @@ -171,4 +164,4 @@ public function run() exit( 4 ); } } -} \ No newline at end of file +}