Category : refactoring

I want to try refactoring this method in my code: def get_params_in_string(params): obj_name = params.PrefetchMethod.split(‘.’)[0] right_method_name = ‘BuhReports.’ if obj_name in (‘AccountAnalysisW’, ‘АнализСчетаW’): obj = AccountAnalysis(None, params, None, None) method_name = right_method_name + ‘GetAccountAnalysis’ elif obj_name in (‘TurnoverSheetW’, ‘ОборотнаяВедомостьW’): obj = TurnoverSheet(None, params, None, None) method_name = right_method_name + ‘GetTurnoverSheet’ elif obj_name in (‘CardAccountW’, ‘КарточкаСчетаW’): ..

Read more