BuildDoctor

Build Doctor

Continuous Integration, Delivery and Devops Consulting

Contact Us

(+44) 207 183 0323
hello@build-doctor.com
@builddoctor

Get in touch!

Finding view logic in your application

Posted on by Julian Simpson

We all know that mixing business logic and presentation is just plain wrong. If you don’t believe me, go have a look at a classic ASP or JSP application of yesteryear. So the prevailing opinion is that we should seek to move business logic into the back end – in MVC applications, the controller (mmm – not always ideal) or the model (perfect).

My colleague Alan and I were discussing this issue – in particular how metric_fu doesn’t inspect our view logic. We have a solution. Here’s the alpha version of our new tool, metric_view_fu. It finds logic buried in HAML view code.


egrep -cir '\- if|\- else|\- while' app/views/* | sort -n -k 2 -t ':'

I think there’s room for improvement.


Be Sociable, Share!

About Julian Simpson

Founder and Editor of The Build Doctor. Drinks Flat Whites. View all posts by Julian Simpson →
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

The Build Doctor Ltd, Suite 17189, Lower Ground Floor, 145-157 St John Street, London, EC1V 4PW

© Build Doctor 2007-2012