Does Your Code Measure Up?
By:
Does Your Code Measure Up? By: Adam Culp Twitter: @ adamculp - - PowerPoint PPT Presentation
Does Your Code Measure Up? By: Adam Culp Twitter: @ adamculp https://joind.in/ 13300 Does Your Code Measure Up? About me PHP 5.3 Certified Consultant at Zend Technologies Organizer SoFloPHP (South Florida) Organized
By:
2
–
PHP 5.3 Certified
–
Consultant at Zend Technologies
–
Organizer SoFloPHP (South Florida)
–
Organized SunshinePHP (Miami)
–
Long distance (ultra) runner
–
Judo Black Belt Instructor
3
–
Pretty much everything requires iteration to do well:
4
–
Not productive
5
–
More accurate, quantifiable
6
–
Highlight bugs
7
–
Highlight bugs
–
Improve quality
8
–
Highlight bugs
–
Improve quality
–
Satisfied customers
9
–
Highlight bugs
–
Improve quality
–
Satisfied customers
–
Personal pride
10
–
Highlight bugs
–
Improve quality
–
Satisfied customers
–
Personal pride
–
Higher salary
11
–
Cyclomatic complexity
source code.” - wikipedia
12
13
–
Cyclomatic complexity
–
Duplicate code
14
–
Cyclomatic complexity
–
Duplicate code
–
Long classes
15
–
Cyclomatic complexity
–
Duplicate code
–
Long classes
–
Class Complexity
16
–
Cyclomatic complexity
–
Duplicate code
–
Long classes
–
Class complexity
–
Long methods
17
–
Cyclomatic complexity
–
Duplicate code
–
Long classes
–
Class complexity
–
Long methods
–
Unused variables
18
–
Cyclomatic complexity
–
Duplicate code
–
Long classes
–
Class complexity
–
Long methods
–
Unused variables
–
Lack or overuse of comments
19
20
–
Cyclomatic complexity
–
Duplicate code
–
Long classes
–
Class complexity
–
Long methods
–
Unused variables
–
Lack or overuse of comments
–
Heavy global usage
21
–
Cyclomatic complexity
–
Duplicate code
–
Long classes
–
Class complexity
–
Long methods
–
Unused variables
–
Lack or overuse of comments
–
Heavy global usage
–
Npath complexity
22
–
Cyclomatic complexity
–
Duplicate code
–
Long classes
–
Class complexity
–
Long methods
–
Unused variables
–
Lack or overuse of comments
–
Heavy global usage
–
Npath complexity
–
Much, much, more
23
–
What are “smells”?
24
–
“Smells” hinting a refactor may be needed:
25
–
Cont'd:
26
–
PHPqatools.org
27
–
PHPqatools.org
28
29
–
PHPqatools.org
30
–
Graphs and XML output
ANDC AHH NOP NOC NOM LOC CYCLO NOM CALLS FANOUT 9891 96646 66812 395815 23359 342 3192 0.585 0.442 9.333 7.318 16.945 0.169 0.102 4.137
Generated by PHP_Depend Low Average High
31
–
PHPqatools.org
32
33
–
PHPqatools.org
– Codesize
34
35
–
PHPqatools.org
– Codesize – Unused
36
–
PHPqatools.org
– Codesize – Unused
– Searches for code no longer used
37
–
PHPqatools.org
–
PHPMetrics
38
39
–
PHPqatools.org
–
PHPMetrics
–
PHP_Codesniffer
40
–
PHPqatools.org
–
PHPMetrics
–
PHP_Codesniffer
–
Code Climate
– Open = free – Private = $
41
–
Build from Git/Github repo
– Open = free – Private = $
42
–
PHPqatools.org
–
PHPMetrics
–
PHP_Codesniffer
–
Code Climate
–
Zend Server and Z-Ray
43
–
Z-Ray
44
–
PHPqatools.org
–
PHPMetrics
–
PHP_Codesniffer
–
Code Climate
–
Zend Server and Z-Ray
–
Apache Bench (apache2-utils in apt)
45
46
–
Measure all the things!
–
Don't fear results, share them
–
Reduce complexity
–
Leave code cleaner than you got it
–
Learn to “smell” problems
–
Use refactoring to fix shortcomings
–
Love iteration!
–
Code: https://github.com/adamculp/refactoring101
–
http://phpqatools.org
–
http://phpmetrics.org
–
http://zend.com
–
http://codeclimate.com
–
Please rate at: https://joind.in/13300
Adam Culp http://www.geekyboy.com Twitter @adamculp