akamensky / argparse

Argparse for golang. Just because `flag` sucks
MIT License
604 stars 62 forks source link

Remove nested loops to check arguments #17

Closed JaikrishnaTS closed 6 years ago

JaikrishnaTS commented 6 years ago

An attempt to fix #2 Needs more testing. Will continue to work as I get reviews

JaikrishnaTS commented 6 years ago

Need to remove unused functions check and reduce from argument.go

akamensky commented 6 years ago

Hi,

Thank you for contribution, for this issue (reducing cyclomatic complexity) may I suggest checking against https://goreportcard.com/report/github.com/akamensky/argparse to see which spots are considered to complex and require simplification. I would love to go over those myself, but my current schedule does not give me enough time for this.

JaikrishnaTS commented 6 years ago

I had a look at the gocyclo points. Apparently the top candidates were check and reduce functions, which get removed with this PR. The next top candidate is argument.go:parse() and command.go:parse(). I have an idea to work on argument.parse, but I'll push that for another PR since its unrelated.

akamensky commented 6 years ago

@JaikrishnaTS Please let me know if you still would be available to follow up on this? Or let me know if that is okay to use these changes from separate commits then?

JaikrishnaTS commented 6 years ago

@akamensky I believe I addressed your comments with e7b6687 Let me know if you'd like to change something else.