I've been programming for a few years, and have become very familiar with C# and JavaScript over time. I have some larger C# and JavaScript projects that I have no trouble navigating around. I recently started a PHP & AngularJS project for work with no prior experience with PHP.The flow of the PHP side of things is becoming hard to keep track of (The JavaScript side is larger, but easy to work through), when I try and think through it I imagine a tangled ball of thread. Major design mistakes that I made when I started are beginning to pile up and effect my design going forward. It takes longer and longer to implement anything new.I'm on a tight deadline and finding it harder and harder to write good, DRY, SOLID, code. It's becoming more enticing to copy/paste chunks of code to make slight variations to it's behavior as design time goes up. It's also taking a long time to get back into the code base whenever I have to do a context switch (From one project then back to this one), I have a feeling of dread whenever I go back to work on this project.What steps can I take to remedy this? The extra time it might take needs to be justifiable as well, my boss is not a developer and is not familiar with development or software life cycles so explaining might be more difficult than normal.
I'm losing track of the flow of my PHP web app, it's becoming hard to work with
php;javascript;web applications;code smell;technical debt
You are taking on technical debt.  The more you justify sloppy code with deadlines the more deadlines will see you achieving less and less.Understand that you can completely get away with this.  No ones going to catch you making a mess and ball you out.  You're just going wake up one day surrounded with clutter.  At that point you'll either update your resume and make it my problem or you'll decide to pay down the debt and spend some time cleaning the code.If you go the cleaning rout understand this isn't about spending more time on design.  This is about breaking some lazy habits and taking out the trash.  Throwing out dirty code wholesale is a bad idea.  Not because of the work that went into it, but because working code captures an idea. Move the idea into clean code before you trash the dirty code.Having unit tests helps with this but if you created your tests with the same care you put into the mess they likely need fixing as well.Don't give into rigidity.  If you can't change it then it's not software.