Coder Presentation

1,805 views

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,805
On SlideShare
0
From Embeds
0
Number of Embeds
33
Actions
Shares
0
Downloads
1
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Coder Presentation

  1. 1. Barcelona DrupalCon Code Review is not just for Standards
  2. 2. (INSERT PICTURE OF BARCELONA) (maybe Gaudi House on Catalunya) Code Review is not just for Standards By Doug Green [email_address] [email_address]
  3. 3. http://drupal.org/project/coder Code Review is not just for Standards <ul><li>Coder Module </li></ul><ul><li>History </li></ul><ul><li>Developer Module, built for you (and me) </li></ul><ul><li>What does it do? </li></ul><ul><li>Credit code-style.pl </li></ul><ul><li>Credit contributors: webchick, nancyw </li></ul>
  4. 4. <ul><li>Style Review </li></ul><ul><li>Upgrade Reviews (4.7.x, 5.x, 6.x) </li></ul><ul><li>Security Reviews </li></ul><ul><li>Performance Reviews </li></ul><ul><li>Types of Reviews </li></ul>Code Review is not just for Standards
  5. 5. <ul><li>Not what this talk is about </li></ul><ul><li>But some simple hints </li></ul><ul><li>Style Review </li></ul>Code Review is not just for Standards
  6. 6. <ul><li>$var .' followed by a quote' </li></ul><ul><li>'quote followed by a '. $var </li></ul><ul><li>while ($space_before_left_paren) </li></ul><ul><li>while ($space_after_right_paren) { </li></ul><ul><li>indent 2 spaces, don't use tabs </li></ul><ul><li>don't end with a ?> </li></ul><ul><li>don't use camelCase or CamelCase </li></ul><ul><li>Common Style Problems </li></ul><ul><li>See http://drupal.org/node/318 </li></ul>Code Review is not just for Standards
  7. 7. <ul><li>FAPI </li></ul><ul><li>Menu </li></ul><ul><li>Schema API </li></ul><ul><li>Info File changes </li></ul><ul><li>... much much more ... </li></ul><ul><li>Drupal 5.x -> 6.x </li></ul><ul><li>See http://drupal.org/node/114774 </li></ul>Code Review is not just for Standards
  8. 8. <ul><li>Run from Drupal 5 </li></ul><ul><li>Run from Drupal 6 (recommended) </li></ul><ul><li>Catches Quite a Bit... </li></ul><ul><li>But it's just a tool that makes suggestions </li></ul><ul><li>You are Smarter than Coder </li></ul><ul><li>Drupal 5.x -> 6.x Upgrade Review </li></ul><ul><li>We've got 10 minutes... </li></ul><ul><li>Let's Upgrade a Module Now! </li></ul>Code Review is not just for Standards
  9. 9. <ul><li>Coder Engine </li></ul><ul><li>What is a Review? </li></ul><ul><li>What is a Rule? </li></ul><ul><li>What is a Regular Expression? </li></ul><ul><li>How does Coder Work? </li></ul>Code Review is not just for Standards
  10. 10. <ul><li>regex </li></ul><ul><li>grep, grep_invert, callback </li></ul><ul><li>Rule Types </li></ul>Code Review is not just for Standards
  11. 11. <ul><li>php (default) </li></ul><ul><li>html </li></ul><ul><li>quote </li></ul><ul><li>doublequote </li></ul><ul><li>comment </li></ul><ul><li>all </li></ul><ul><li>Rule Sources </li></ul>Code Review is not just for Standards
  12. 12. array( '#type' => 'regex', '#value' => '_form_alters*($', ... ), <ul><li>Example Rule: </li></ul><ul><li>See http://drupal.org/node/144172 </li></ul>Code Review is not just for Standards
  13. 13. array( '#type' => 'regex', '#function' => '_menu$', '#value' => '$items[]s*=', ... ), <ul><li>Another Example Rule: </li></ul><ul><li>See http://drupal.org/node/144172 </li></ul>Code Review is not just for Standards
  14. 14. array( '#type' => 'regex', '#value' => 'global $locale', ... ), <ul><li>One More Example: </li></ul><ul><li>See http://drupal.org/node/144172 </li></ul>Code Review is not just for Standards
  15. 15. <ul><li>Coderis only as good as the Rules </li></ul><ul><li>Lot's of contributors </li></ul><ul><li>But 1 Developer (so far) </li></ul><ul><li>Please submit ideas </li></ul><ul><li>Please submit Review/Rules Patches </li></ul><ul><li>You can do it! </li></ul><ul><li>Really :) </li></ul><ul><li>It's your tool, and I need help </li></ul><ul><li>Really ! </li></ul><ul><li>Why All the Examples Doug? </li></ul>Code Review is not just for Standards
  16. 16. <ul><li>Security </li></ul><ul><li>Performance </li></ul><ul><li>Potential </li></ul>Code Review is not just for Standards
  17. 17. [email_address] http://drupal.org/project/coder Code Review is not just for Standards

×