It's a "simple method", but it's responsible for a bunch of initialization, so yeah, it's kind of expected to be long.
Notice, though, that each section is pretty straightforward in what it does...basically forEach's.
You could make the argument for greater polymorphism in types, or something like a visitor pattern over collections or something, but honestly this is readable and maintainable code.
More comments at the function declaration would've been nice, but the implementation is pretty straightforward.
Notice, though, that each section is pretty straightforward in what it does...basically forEach's.
You could make the argument for greater polymorphism in types, or something like a visitor pattern over collections or something, but honestly this is readable and maintainable code.
More comments at the function declaration would've been nice, but the implementation is pretty straightforward.