jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
SonarQube Plugins
  • SonarQube Plugins
  • SONARPLUGINS-31

Scan PHP projects

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: PHP-0.2
  • Component/s: PHP
  • Labels:
    None
  • Number of attachments :
    2

Description

Useful PHP libraries :

  • PHPUnit : unit tests, code coverage and software metrics
  • PHP_CodeSniffer : code and detects violations of a defined set of coding standards
  • PHP under control : PHP continuous integration into cruisecontrol

Article on PHP and software metrics by Sebastian Bergmann

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. GZip Archive
    Money.tar.gz
    13/Mar/09 5:38 AM
    4 kB
    Sebastian Bergmann
  2. GZip Archive
    Money.tar.gz
    08/Jan/09 3:40 AM
    9 kB
    Sebastian Bergmann

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Simon Brandhof added a comment - 28/Oct/08 9:36 AM

Forum PHP Paris 2008 is on december.Two sessions are about PHP code analysis :

  • Automatiser les rapports sur la qualité du code
  • Static and Dynamic Analysis at Ning

I hope slides will be published.

Show
Simon Brandhof added a comment - 28/Oct/08 9:36 AM Forum PHP Paris 2008 is on december.Two sessions are about PHP code analysis : Automatiser les rapports sur la qualité du code Static and Dynamic Analysis at Ning I hope slides will be published.
Hide
Permalink
Simon Brandhof added a comment - 04/Jan/09 2:15 PM

Thanks to Sebastian Bergmann for the following details :

Both Apache Ant and Maven are used in the PHP world. We also have
Phing [1] which is a port of Apache Ant to PHP.

PHP_Depend [2] and PHP_CodeSniffer [3] calculate software metrics
such as Cyclomatic Complexity, NPath Complexity, and the likes.

PHP_Depend produces JDepend XML (and in the future PMD XML),
PHP_CodeSniffer produces Checkstyle XML.

PHP_CodeSniffer [3] performs a static code analysis for coding
standard violations, bug patterns, etc.

PHPUnit [4] has support for software metrics and can write violation
reports in PMD XML format. This feature does not belong into a unit
test framework, though, which is why it is currently moved out of
PHPUnit. In the future, PHP_Depend [2] will produce PMD-style logfile.
See [5] for details.

PHPUnit [4] produces unit test results in JUnit XML and code coverage
data in Clover XML as well as an HTML report of code coverage.

[1] http://phing.info/
[2] http://pdepend.org/
[3] http://pear.php.net/package/PHP_CodeSniffer
[4] http://www.phpunit.de/
[5] http://tinyurl.com/7dv44l

Show
Simon Brandhof added a comment - 04/Jan/09 2:15 PM Thanks to Sebastian Bergmann for the following details : Both Apache Ant and Maven are used in the PHP world. We also have Phing [1] which is a port of Apache Ant to PHP. PHP_Depend [2] and PHP_CodeSniffer [3] calculate software metrics such as Cyclomatic Complexity, NPath Complexity, and the likes. PHP_Depend produces JDepend XML (and in the future PMD XML), PHP_CodeSniffer produces Checkstyle XML. PHP_CodeSniffer [3] performs a static code analysis for coding standard violations, bug patterns, etc. PHPUnit [4] has support for software metrics and can write violation reports in PMD XML format. This feature does not belong into a unit test framework, though, which is why it is currently moved out of PHPUnit. In the future, PHP_Depend [2] will produce PMD-style logfile. See [5] for details. PHPUnit [4] produces unit test results in JUnit XML and code coverage data in Clover XML as well as an HTML report of code coverage. [1] http://phing.info/ [2] http://pdepend.org/ [3] http://pear.php.net/package/PHP_CodeSniffer [4] http://www.phpunit.de/ [5] http://tinyurl.com/7dv44l
Hide
Permalink
Sebastian Bergmann added a comment - 08/Jan/09 3:40 AM

sb@ubuntu ~ % tar xvfz Money.tar.gz
Money/
Money/Money.php
Money/IMoney.php
Money/MoneyTest.php
Money/build/
Money/build/logs/
Money/build/logs/jdepend.xml
Money/build/logs/checkstyle.xml
Money/build/logs/clover.xml
Money/build/logs/pdepend.xml
Money/build/logs/junit.xml
Money/build.xml
Money/MoneyBag.php
sb@ubuntu ~ % cd Money
sb@ubuntu Money % ant
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk/lib/tools.jar
Buildfile: build.xml

clean:
[delete] Deleting directory /home/sb/Money/build

prepare:
[mkdir] Created dir: /home/sb/Money/build/logs

phpunit:
[exec] PHPUnit @package_version@ by Sebastian Bergmann.
[exec]
[exec] ......................
[exec]
[exec] Time: 0 seconds
[exec]
[exec] OK (22 tests, 34 assertions)
[exec]
[exec] Writing code coverage data to XML file, this may take a moment.

phpcs:
[exec] Result: 1

pdepend:
[exec] PHP_Depend 0.9.2 by Manuel Pichler
[exec]
[exec] Parsing source files:
[exec] .... 4
[exec]
[exec] Executing NodeLoc-Analyzer:
[exec] ... 75
[exec]
[exec] Executing CodeRank-Analyzer:
[exec] 8
[exec]
[exec] Executing CyclomaticComplexity-Analyzer:
[exec] ... 71
[exec]
[exec] Executing ClassLevel-Analyzer:
[exec] ... 68
[exec]
[exec] Executing Hierarchy-Analyzer:
[exec] ... 77
[exec]
[exec] Executing NPathComplexity-Analyzer:
[exec] ... 71
[exec]
[exec] Executing Dependency-Analyzer:
[exec] ... 71
[exec]
[exec] Executing NodeCount-Analyzer:
[exec] ... 68
[exec]
[exec] Executing Inheritance-Analyzer:
[exec] 20
[exec]
[exec] Executing Coupling-Analyzer:
[exec] .... 86
[exec]
[exec] Generating pdepend log files, this may take a moment.

build:

BUILD SUCCESSFUL
Total time: 3 seconds

Show
Sebastian Bergmann added a comment - 08/Jan/09 3:40 AM sb@ubuntu ~ % tar xvfz Money.tar.gz Money/ Money/Money.php Money/IMoney.php Money/MoneyTest.php Money/build/ Money/build/logs/ Money/build/logs/jdepend.xml Money/build/logs/checkstyle.xml Money/build/logs/clover.xml Money/build/logs/pdepend.xml Money/build/logs/junit.xml Money/build.xml Money/MoneyBag.php sb@ubuntu ~ % cd Money sb@ubuntu Money % ant Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk/lib/tools.jar Buildfile: build.xml clean: [delete] Deleting directory /home/sb/Money/build prepare: [mkdir] Created dir: /home/sb/Money/build/logs phpunit: [exec] PHPUnit @package_version@ by Sebastian Bergmann. [exec] [exec] ...................... [exec] [exec] Time: 0 seconds [exec] [exec] OK (22 tests, 34 assertions) [exec] [exec] Writing code coverage data to XML file, this may take a moment. phpcs: [exec] Result: 1 pdepend: [exec] PHP_Depend 0.9.2 by Manuel Pichler [exec] [exec] Parsing source files: [exec] .... 4 [exec] [exec] Executing NodeLoc-Analyzer: [exec] ... 75 [exec] [exec] Executing CodeRank-Analyzer: [exec] 8 [exec] [exec] Executing CyclomaticComplexity-Analyzer: [exec] ... 71 [exec] [exec] Executing ClassLevel-Analyzer: [exec] ... 68 [exec] [exec] Executing Hierarchy-Analyzer: [exec] ... 77 [exec] [exec] Executing NPathComplexity-Analyzer: [exec] ... 71 [exec] [exec] Executing Dependency-Analyzer: [exec] ... 71 [exec] [exec] Executing NodeCount-Analyzer: [exec] ... 68 [exec] [exec] Executing Inheritance-Analyzer: [exec] 20 [exec] [exec] Executing Coupling-Analyzer: [exec] .... 86 [exec] [exec] Generating pdepend log files, this may take a moment. build: BUILD SUCCESSFUL Total time: 3 seconds
Hide
Permalink
Sebastian Bergmann added a comment - 13/Mar/09 5:38 AM

Updated example project.

Show
Sebastian Bergmann added a comment - 13/Mar/09 5:38 AM Updated example project.
Hide
Permalink
Sebastian Bergmann added a comment - 13/Mar/09 5:40 AM

sb@ubuntu Money % ant
Buildfile: build.xml

clean:

prepare:
[mkdir] Created dir: /home/sb/Money/build/logs

phpcs:

phpmd:

phpcpd:
[exec] phpcpd @package_version@ by Sebastian Bergmann.
[exec]
[exec] 0.00% duplicated lines out of 722 total lines of code.

pdepend:
[exec] PHP_Depend @package_version@ by Manuel Pichler
[exec]
[exec] Executing Dependency-Analyzer:
[exec] 16
[exec]
[exec] Generating pdepend log files, this may take a moment.

phpunit:
[exec] PHPUnit @package_version@ by Sebastian Bergmann.
[exec]
[exec] ......................
[exec]
[exec] Time: 0 seconds
[exec]
[exec] OK (22 tests, 34 assertions)
[exec]
[exec] Writing code coverage data to XML file, this may take a moment.

build:

BUILD SUCCESSFUL
Total time: 4 seconds

Show
Sebastian Bergmann added a comment - 13/Mar/09 5:40 AM sb@ubuntu Money % ant Buildfile: build.xml clean: prepare: [mkdir] Created dir: /home/sb/Money/build/logs phpcs: phpmd: phpcpd: [exec] phpcpd @package_version@ by Sebastian Bergmann. [exec] [exec] 0.00% duplicated lines out of 722 total lines of code. pdepend: [exec] PHP_Depend @package_version@ by Manuel Pichler [exec] [exec] Executing Dependency-Analyzer: [exec] 16 [exec] [exec] Generating pdepend log files, this may take a moment. phpunit: [exec] PHPUnit @package_version@ by Sebastian Bergmann. [exec] [exec] ...................... [exec] [exec] Time: 0 seconds [exec] [exec] OK (22 tests, 34 assertions) [exec] [exec] Writing code coverage data to XML file, this may take a moment. build: BUILD SUCCESSFUL Total time: 4 seconds
Hide
Permalink
Mike Willbanks added a comment - 16/Mar/09 11:50 AM

I would also like to comment as to not forget about Hudson and Bamboo when focusing on this project for continuous integration servers.

Simon already commented on the additional PHP packages that are typically fairly heavily utilized.

Show
Mike Willbanks added a comment - 16/Mar/09 11:50 AM I would also like to comment as to not forget about Hudson and Bamboo when focusing on this project for continuous integration servers. Simon already commented on the additional PHP packages that are typically fairly heavily utilized.
Hide
Permalink
Sebastian Bergmann added a comment - 24/Aug/09 1:35 AM

Is someone still working on this? Thanks!

Show
Sebastian Bergmann added a comment - 24/Aug/09 1:35 AM Is someone still working on this? Thanks!
Hide
Permalink
Freddy Mallet added a comment - 26/Aug/09 7:44 AM

Hi Sebastian, Julien has worked on it in May/June but currently this development seems frozen.

Show
Freddy Mallet added a comment - 26/Aug/09 7:44 AM Hi Sebastian, Julien has worked on it in May/June but currently this development seems frozen.
Hide
Permalink
Gabriele Santini added a comment - 09/May/10 2:34 AM

All of this works now

Show
Gabriele Santini added a comment - 09/May/10 2:34 AM All of this works now

People

  • Assignee:
    Unassigned
    Reporter:
    Simon Brandhof
Vote (8)
Watch (8)

Dates

  • Created:
    02/Jul/08 6:54 AM
    Updated:
    09/May/10 6:00 AM
    Resolved:
    09/May/10 6:00 AM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.