Web Development – Demanding Code Quality on a New Project

drupalPHPproject-managementweb-development

I have been given a Drupal project from an external web agency and have been trying to becomer wiser on both Drupal and their approach of making a site. With time I've learnt a bit morer about Drupal, even though I've come to notice it really isn't my cup of tea. Recently, I tried to "simply" replace the HTML generation of a part of the site, which seemed to be generated through a custom module (their addons for the site). I changed that code and realised that the effect simply didn't alter anything, or at least I thought.

Basicly now I've without exaggerating replaced the same piece of code with very small differences 26 times, and it's still not changing everywhere. So what I'm dealing with is a set of code that have literally never or barely heard of global class nor function and is simply copy & paste'd all over the site.

I'm curious on what I'm supposed to do with this. There's one file alone that has over 3000 lines of basicly the exact same code 16 times over. If you order a web agency to develop at site, can you expect it to be common sence that the code should be at least a little maintainable and simply not a big piece of code, more annoying to edit than far more necessary, or does it specifically have to be requested and I should had instead had to validate the code before paying for the handover of the site?

This is the first time I have ever came across such a poorly written piece of code in my career and it feels as if we bought a good looking suit that we saw from the outside of the store, and all we got was a poster of that suit for the same price.

The question

What would be the appropriate thing to do in my case? Should I suck it up and convince my employer that the code is poorly written in hope that my given deadline for completing the project gets extended, or can I demand the web agency to do some action?

EDIT:
Thanks for all your answers! They help me get some more perspective on this. I will discuss this internally a bit more, and try to mark out the best answer, even though most of yours covers the same but also different fields of the question.

Best Answer

While I absolutely agree about demanding code quality, it IS very difficult to quantify, and if you have nothing in your contract with the agency then I don't see how you can get them to rework a presumably working solution.

Maybe the only thing you can take from this for the future is trying to come up with some kind of code quality control on top of your user acceptance testing when the provider deliver the solution.

If the code is really that bad, it may mean you simply do not hire that company again. There may be some mileage in informing the company of your concerns over their code quality, and in a bid to try and keep you as a customer, they may try and go above and beyond their contract, but your mileage will vary with this approach.

Related Topic