Symfony Components in Legacy Code

I just watched PHPNW13 Saturday Track 3 Talk 4: Hugo Hamon – Bringing the Symfony Components into your Legacy Code. The talk was great with the example slides.
Also the mentioned tools phploc (PHP Lines Of Code perhaps 🙂 and phpcpd (PHP Copy/Paste Detector) are great.

UPDATE 2015-04-05: Jakub Zalas posted his research data about Symfony adoption

PHPloc example output:

phploc 2.1.0 by Sebastian Bergmann.

Directories 280
Files 1426

Size
 Lines of Code (LOC) 263934
 Comment Lines of Code (CLOC) 46562 (17.64%)
 Non-Comment Lines of Code (NCLOC) 217372 (82.36%)
 Logical Lines of Code (LLOC) 90186 (34.17%)
 Classes 66072 (73.26%)
 Average Class Length 39
 Minimum Class Length 0
 Maximum Class Length 17069
 Average Method Length 4
 Minimum Method Length 0
 Maximum Method Length 1999
 Functions 4640 (5.14%)
 Average Function Length 6
 Not in classes or functions 19474 (21.59%)

Cyclomatic Complexity
 Average Complexity per LLOC 0.35
 Average Complexity per Class 14.18
 Minimum Class Complexity 1.00
 Maximum Class Complexity 10218.00
 Average Complexity per Method 2.58
 Minimum Method Complexity 1.00
 Maximum Method Complexity 1542.00

Dependencies
 Global Accesses 9177
 Global Constants 5986 (65.23%)
 Global Variables 720 (7.85%)
 Super-Global Variables 2471 (26.93%)
 Attribute Accesses 34977
 Non-Static 34535 (98.74%)
 Static 442 (1.26%)
 Method Calls 17084
 Non-Static 16260 (95.18%)
 Static 824 (4.82%)

Structure
 Namespaces 1
 Interfaces 0
 Traits 0
 Classes 1667
 Abstract Classes 9 (0.54%)
 Concrete Classes 1658 (99.46%)
 Methods 13905
 Scope
 Non-Static Methods 13662 (98.25%)
 Static Methods 243 (1.75%)
 Visibility
 Public Methods 13589 (97.73%)
 Non-Public Methods 316 (2.27%)
 Functions 728
 Named Functions 727 (99.86%)
 Anonymous Functions 1 (0.14%)
 Constants 861
 Global Constants 487 (56.56%)
 Class Constants 374 (43.44%)
Advertisements

About Michal Zuber

Biker and rollerblader. Owner and developer at http://nevilleweb.sk/ Co-founded http://neville.sk/ Blog at https://michalzuber.wordpress.com/
This entry was posted in php and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s