Python, DOT and Visualising Legacy Code The Lazy Way
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Python, DOT and Visualising Legacy Code The Lazy Way

  • 1,675 views
Uploaded on

Visualising a legacy PHP codebase using Python, DOT and GraphViz. A lightning talk for the London Python Code Dojo 2011-06-02.

Visualising a legacy PHP codebase using Python, DOT and GraphViz. A lightning talk for the London Python Code Dojo 2011-06-02.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,675
On Slideshare
1,674
From Embeds
1
Number of Embeds
1

Actions

Shares
Downloads
8
Comments
0
Likes
1

Embeds 1

http://www.linkedin.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Python, DOT and Visualising Legacy Code The Lazy Way (C) John Chandler 2011
  • 2. Legacy PHP Code! Noooooooooooooo!!!!
  • 3. Deep Breaths. Visualise the Code.
  • 4. Laziness Part 1: Use Python to Analyse Dependencies
  • 5. Write a PHP Parser in Python? Or use a regular expression... (include|require)(?:_once)?[ (]["']([^"']+)["']
  • 6. Laziness Part 2: Use Graphviz to Draw The Diagram
  • 7. Graphviz supports DOT. DOT is a graphing mini-language
  • 8. digraph foo { node1 [label=“Node 1”]; node2 [label=”Node 2”]; node1 -> node2; }
  • 9. $ dot -Tpng -O foo.dot
  • 10. WTF. Looks like some refactoring to do
  • 11. Source is available under GPL v3 from: http://www.bitbucket.org/metaljoe/qadpid