4 ms·
Comment is now dead but I'd significantly refactor this code where I wouldn't be using nulls or empty strings as program flow control. At the very least I'd hav
by ones_and_zeros 11y ago
Comment is now dead but I'd significantly refactor this code where I wouldn't be using nulls or empty strings as program flow control. At the very least I'd have an enum that was very explicit of what action I should be taking ie TEXT, PHOTO, VIDEO, etc.
The logic is too mixed up and this method does too many things. Off the top of my head you might refactor it so that inspection, classification, validation, preparation, etc all happen separately, right now this method does them all and then some.
- newjersey 11y agoOh wow you sound like Uncle Bob (and I say that as a compliment). I think you're right. There is a lot of room for refactoring here. A few more (business/model) classes would not hurt here.