Skip to content

Commit cd14e3c

Browse files
committed
Initial commit
0 parents  commit cd14e3c

21 files changed

+1824
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea/
2+
vendor/
3+
composer.lock

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 andrey-tech
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

bin/pdepend-summary-formatter

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
/**
5+
* @author andrey-tech
6+
* @copyright 2023 andrey-tech
7+
* @link https://github.com/andrey-tech/
8+
* @license MIT
9+
*/
10+
11+
declare(strict_types=1);
12+
13+
use AndreyTech\Pdepend\Summary\Formatter\Application;
14+
15+
include_once __DIR__ . '/../autoload.php';
16+
17+
$application = new Application();
18+
$exitCode = $application->run();
19+
exit($exitCode);

composer.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"name": "andrey-tech/dpepend-summary-formatter-php",
3+
"description": "",
4+
"keywords": [ "dpepend", "metrics", "php" ],
5+
"homepage": "https://github.com/andrey-tech/pdepend-summary-formatter-php",
6+
"minimum-stability": "stable",
7+
"license": "MIT",
8+
"authors": [
9+
{
10+
"name": "andrey-tech",
11+
"homepage": "https://github.com/andrey-tech/",
12+
"role": "Developer"
13+
}
14+
],
15+
"support": {
16+
"issues": "https://github.com/andrey-tech/pdepend-summary-formatter-php/issues",
17+
"source": "https://github.com/andrey-tech/pdepend-summary-formatter-php"
18+
},
19+
20+
"require": {
21+
"php": "^7.4 || ^8.0",
22+
"ext-simplexml": "*",
23+
"symfony/console": "^4.4 || ^5.4 || ^6.3",
24+
"symfony/yaml": "^4.4 || ^5.4 || ^6.3"
25+
},
26+
"require-dev": {
27+
"overtrue/phplint": "^3.4",
28+
"phpmd/phpmd": "^2.14",
29+
"slevomat/coding-standard": "^8.13",
30+
"squizlabs/php_codesniffer": "^3.7",
31+
"vimeo/psalm": "^5.15"
32+
},
33+
"config": {
34+
"sort-packages": true,
35+
"allow-plugins": {
36+
"dealerdirect/phpcodesniffer-composer-installer": true
37+
}
38+
},
39+
"autoload": {
40+
"psr-4": {
41+
"AndreyTech\\": "src/AndreyTech"
42+
}
43+
},
44+
"bin": [
45+
"bin/pdepend-summary-formatter"
46+
],
47+
"scripts": {
48+
"lint": "phplint --configuration=phplint.yml.dist",
49+
"cs": "phpcs -s -p --report=full --standard=phpcs.xml.dist",
50+
"psalm": "psalm --long-progress --output-format=compact --config=psalm.xml.dist",
51+
"phpmd": "phpmd src ansi phpmd.xml.dist --suffixes php"
52+
}
53+
}
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
colorizer:
2+
metrics:
3+
4+
# Metrics of class
5+
class:
6+
7+
# https://learn.microsoft.com/en-us/visualstudio/code-quality/code-metrics-class-coupling?view=vs-2022
8+
# https://phpmd.org/rules/design.html#couplingbetweenobjects
9+
# https://pdepend.org/documentation/software-metrics/coupling-between-objects.html
10+
cbo:
11+
green: [ 0, 12 ],
12+
red+bold: [ 13, null ]
13+
14+
# https://phpmd.org/rules/codesize.html#excessiveclasslength
15+
loc:
16+
green: [ 0, 999 ]
17+
red+bold: [ 1000, null ]
18+
19+
# https://phpmd.org/rules/codesize.html#excessivepubliccount
20+
# https://pdepend.org/documentation/software-metrics/class-interface-size.html
21+
# https://pdepend.org/documentation/software-metrics/class-size.html
22+
cis:
23+
green: [ 0, 44 ]
24+
red+bold: [ 45, null ]
25+
26+
# https://phpmd.org/rules/codesize.html#toomanymethods
27+
nom:
28+
green: [ 0, 24 ]
29+
red+bold: [ 25, null ]
30+
31+
# https://phpmd.org/rules/codesize.html#toomanypublicmethods
32+
npm:
33+
green: [ 0, 9 ]
34+
red+bold: [ 10, null ]
35+
36+
# https://phpmd.org/rules/codesize.html#toomanyfields
37+
vars:
38+
green: [ 0, 14 ],
39+
red+bold: [ 15, null ]
40+
41+
# https://phpmd.org/rules/codesize.html#excessiveclasscomplexity
42+
# https://pdepend.org/documentation/software-metrics/weighted-method-count.html
43+
wmc:
44+
green: [ 0, 49 ]
45+
red+bold: [ 50, null ]
46+
47+
# https://learn.microsoft.com/ru-ru/visualstudio/code-quality/code-metrics-depth-of-inheritance?view=vs-2022
48+
# https://phpmd.org/rules/design.html#depthofinheritance
49+
dit:
50+
green: [ 0, 5 ]
51+
red+bold: [ 6, null ]
52+
53+
# https://phpmd.org/rules/design.html#numberofchildren
54+
nocc:
55+
green: [ 0, 14 ]
56+
red+bold: [ 15, null ]
57+
58+
# Metrics of method
59+
method:
60+
61+
# https://learn.microsoft.com/ru-ru/visualstudio/code-quality/code-metrics-cyclomatic-complexity?view=vs-2022
62+
# https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
63+
ccn:
64+
green: [ 1, 7 ]
65+
yellow+bold: [ 8, 10 ]
66+
red+bold: [ 11, null ]
67+
68+
# https://stackoverflow.com/questions/27954015/cyclomatic-complexity-and-variants
69+
ccn2:
70+
green: [ 1, 7 ]
71+
yellow+bold: [ 8, 10 ]
72+
red+bold: [ 11, null ]
73+
74+
# https://phpmd.org/rules/codesize.html#npathcomplexity
75+
# https://modess.io/npath-complexity-cyclomatic-complexity-explained/
76+
npath:
77+
green: [ 1, 199 ]
78+
red+bold: [ 200, null ]
79+
80+
# https://learn.microsoft.com/en-us/visualstudio/code-quality/code-metrics-maintainability-index-range-and-meaning?view=vs-2022
81+
# https://habr.com/en/articles/111524/
82+
# https://forum.itvdn.com/t/o-chyom-govorit-metrika-maintainability-index/2423
83+
# https://verifysoft.com/en_maintainability.html
84+
# https://www.ijert.org/research/maintainability-index-over-multiple-releases-a-case-study-php-open-source-software-IJERTV1IS6424.pdf
85+
mi:
86+
green: [ 60, 100 ]
87+
yellow+bold: [ 50, 60 ]
88+
red+bold: [ 0, 50 ]
89+
90+
# https://phpmd.org/rules/codesize.html#excessivemethodlength
91+
loc:
92+
green: [ 0, 99 ]
93+
red+bold: [ 100, null ]
94+
95+
# https://en.wikipedia.org/wiki/Halstead_complexity_measures
96+
hb:
97+
green: [ 0, 0.09 ]
98+
yellow+bold: [ 0.10, 0.19 ]
99+
red+bold: [ 0.20, null ]
100+
101+
# https://en.wikipedia.org/wiki/Halstead_complexity_measures
102+
# https://github.com/escomplex/complexity-report/blob/master/.complexrc.example
103+
hd:
104+
green: [ 0, 15 ]
105+
yellow+bold: [ 15, 20 ]
106+
red+bold: [ 20, null ]
107+
108+
# https://en.wikipedia.org/wiki/Halstead_complexity_measures
109+
hv:
110+
green: [ 0, 400 ]
111+
yellow+bold: [ 400, 500 ]
112+
red+bold: [ 500, null ]
113+
114+
# https://en.wikipedia.org/wiki/Halstead_complexity_measures
115+
he:
116+
green: [ 0, 4000 ]
117+
yellow+bold: [ 4000, 5000 ]
118+
red+bold: [ 5000, null ]
119+
120+
# https://www.artima.com/weblogs/viewpost.jsp?thread=210575
121+
# https://stackoverflow.com/questions/4731774/how-to-read-improve-c-r-a-p-index-calculated-by-php
122+
crap0:
123+
green: [ 0, 29 ]

0 commit comments

Comments
 (0)