Also, in general terms over use of DRY can lead you here.
In many cases it is better to “risk” higher CC by concentrating logic where it makes sense.
Also, in general terms over use of DRY can lead you here.
In many cases it is better to “risk” higher CC by concentrating logic where it makes sense.
But if you're a large team on a large project logic sparsity (with appropriate decoupling!) makes sense because then multiple people can change the code simultaneously without stepping on each others' toes. People can specialise where appropriate without having to understand the whole thing. The "sparsity" approach is obviously what enterprises see as good news mostly because it means they can have large teams without silos but in real terms it costs a lot of money to operate this way. Although I think as you rightly point out, Java has in recent years realised that it possibly went a bit too far in that direction historically.
In theory, the idea that "people can specialise where appropriate without having to understand the whole thing" sounds good. In reality, so many, many, many bugs and piles of technical debt pile up from developers with a worms eye view who don't understand how the whole system works. Eventually you have to make this compromise, but resist it as much as you reasonably can, and always strive to grow developers so they know as much of the system as they possibly can.
Unfortunately, in some (many?) companies there simply aren't enough experienced engineers who have the time to do the active balancing...leading us back to "just stick this rule in pipeline so the teams are held to _some standard_".
Of course some teams will over use such tools and turn off the metrics left and right.
In the end there is no substitute for experienced engineers.
https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...