Of the remainder more than half of the code had a short lifespan once it went live. Less than five years, some of it just a few months or a year.
I’ve worked on a handful of projects that have lifespans of a decade or more, but they stand out as the exceptions. The long-lived code stayed in production mainly because of organizational inertia, not because of exceptional code quality.
I keep all that in mind when tempted to polish a likely turd in the name of “code quality” and “best practices.”
Hell, if it was never used, but the features were interesting to build, I wouldn't have a problem at all. I prefer to work on systems that have code released as frequently as possible in direct response to customer inquiry. You know that code is being used and someone is benefiting from it.
Once you go live, it's far easier to release new things. You can spend 2 years working on things that never come out. There, 100% of your time is spent working on things that fail to launch. But after the launch, that 100% is converted to 0% for the whole two years. You work on something else for the week, and then that goes live the next week too.
Also the team has to hold together long enough for launches too. No layoffs, salaries good enough, tech debt low enough. This seems to happen more further up the career ladder.
At work the answer is probably about 5-10% of my time. Most of the work I've done at companies is either building something for clients (who usually want a website or app at the end of it), or for the company itself (ditto). For better or worse, the sunk cost fallacy is ubiquitous in the corporate world too.
For personal projects on the other hand, it's probably 40-50% of my time. Likely in part because I start and end a lot of projects really quickly, and spend way longer on the remaining ones than I should do.
At home probably more like 80% of my time