shrink / phploc
1.7.6
2013-06-12 09:59 UTC
Requires
- php: >=5.3.3
- sebastian/finder-facade: >=1.1.0
- sebastian/git: >=1.0.0
- sebastian/version: >=1.0.0
- zetacomponents/console-tools: 1.6
This package is not auto-updated.
Last update: 2016-06-25 01:02:37 UTC
README
phploc
是一款快速测量PHP项目大小和结构的工具。
安装
安装PHPLOC有三种支持方式。
您可以使用PEAR安装程序或Composer下载并安装PHPLOC及其依赖项。您还可以下载包含PHPLOC所有必需(以及一些可选)依赖项的PHP存档(PHAR)。
PEAR安装程序
以下两个命令(您可能需要以root
身份运行)是使用PEAR安装程序安装PHPLOC所需的全部。
pear config-set auto_discover 1
pear install pear.phpunit.de/phploc
Composer
要将PHPLOC添加为项目依赖项,只需在项目的composer.json
文件中添加对phploc/phploc
的依赖项。以下是一个定义PHPLOC最新稳定版本的开发时间依赖项的composer.json
文件的最小示例。
{
"require-dev": {
"phploc/phploc": "*"
}
}
PHP存档(PHAR)
wget http://pear.phpunit.de/get/phploc.phar
chmod +x phploc.phar
使用示例
➜ ~ phploc /usr/local/src/phpunit/PHPUnit
phploc 2.0.0 by Sebastian Bergmann.
Directories 17
Files 121
Size
Lines of Code (LOC) 29022
Comment Lines of Code (CLOC) 14155 (48.77%)
Non-Comment Lines of Code (NCLOC) 14867 (51.23%)
Logical Lines of Code (LLOC) 3477 (11.98%)
Classes 3307 (95.11%)
Average Class Length 29
Average Method Length 4
Functions 153 (4.40%)
Average Function Length 1
Not in classes or functions 17 (0.49%)
Complexity
Cyclomatic Complexity / LLOC 0.51
Cyclomatic Complexity / Number of Methods 3.36
Dependencies
Global Accesses 43
Global Constants 1 (2.33%)
Global Variables 34 (79.07%)
Super-Global Variables 8 (18.60%)
Attribute Accesses 1174
Non-Static 1054 (89.78%)
Static 120 (10.22%)
Method Calls 1502
Non-Static 976 (64.98%)
Static 526 (35.02%)
Structure
Namespaces 0
Interfaces 6
Traits 0
Classes 113
Abstract Classes 9 (7.96%)
Concrete Classes 104 (92.04%)
Methods 750
Scope
Non-Static Methods 507 (67.60%)
Static Methods 243 (32.40%)
Visibility
Public Method 526 (70.13%)
Non-Public Methods 224 (29.87%)
Functions 142
Named Functions 138 (97.18%)
Anonymous Functions 4 (2.82%)
Constants 36
Global Constants 2 (5.56%)
Class Constants 34 (94.44%)