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.
"There's one file alone that has over 3000 lines of basicly the exact same code 16 times over."
is something I consider a screw up regardless of years in the business.