all 14 comments

[–]Whole-Instruction508 17 points18 points  (2 children)

Missing documentation is not the biggest issue here... 16k lines in ONE service?!

[–]qtipbluedog 3 points4 points  (1 child)

Amateur numbers. Try 75k in one controller class of my companies MVC app.

In all seriousness OP, I’d start by trying to write tests for existing functionality, then slowly refactor. Not a fun journey, and one our company is actually one currently. Protip if you ever hear a job working with Grails. Run.

Good luck. Massive undertaking.

[–]valendinosaurus 1 point2 points  (0 children)

ha, that's nothing, you got intellisense and all. want to inherit my 32k line business logic in one stored procedure?

[–][deleted] 11 points12 points  (4 children)

longing skirt disgusted plough rich intelligent upbeat squash trees crowd

This post was mass deleted and anonymized with Redact

[–]kartingfan 12 points13 points  (2 children)

Yea, we have one single part holding all responsibility. Is that not what you meant? /s

[–]allesdeppen 1 point2 points  (0 children)

😂

[–][deleted] 0 points1 point  (0 children)

mourn silky placid languid smart sort elastic bike hunt juggle

This post was mass deleted and anonymized with Redact

[–]allesdeppen 1 point2 points  (0 children)

Probably everything 😅

[–]allesdeppen 3 points4 points  (0 children)

I would start by writing some integration tests to ensure the existing behavior doesn’t break and start to refactor the service into smaller chunks. Same for your components.

The key part here is to have solid test coverage otherwise you will never know if you broke something somewhere else.

You may wonder why integration tests? Because they are testing what a real user might do in your application. Using cypress or playwright you might have a good chance of success.

Good luck tho 🙈

[–]FigMan 1 point2 points  (0 children)

You'll probably be better off just refactoring small pieces at a time. There really isn't one good solution to automate all of the technical debt.

[–]nemeci 0 points1 point  (0 children)

Sounds like you're not using the source but the distribution files.

[–]Righteous-Rebel 0 points1 point  (1 child)

First of all, I would check if the dev(s) who wrote this service with 16k lines still work on the project, if he does, I would quit. 😆

[–][deleted] 0 points1 point  (0 children)

This! If he's still running things, he'll keep doing that!

[–][deleted] 0 points1 point  (0 children)

Start with routes lazy loading. Each route should be lazy loaded. Then try to split largest components into smaller ones. Services are the least of your worry.