tl-its-umich-edu / canvas

Integration scripts between ITS TL and Instructure Canvas
Other
3 stars 8 forks source link

TLUNIZIN-1051 checks for section id format first #84

Closed zqian closed 8 years ago

dlhaines commented 8 years ago

The functionality looks ok, but the code is hard to read, test, (and maintain). I believe you could do an early exit or next if the 9 digit check fails but I'm not sure. The nesting could be reduced a lot if any if or else clause over 5 lines long was made into a separate method. Also, IMHO, it would be clearer if the loops were just used to manage feeding chunks of data to a method. E.g. have a loop to hand each term to a method that handles a single term, which, in turn, hands each course in that term to a method that handles a single course.