fossasia / open-event-server

Function with cyclomatic complexity higher than threshold PY-R1000
Anti-pattern
Minor
5 months ago8 months old
export_speakers_csv has a cyclomatic complexity of 20 with "high" risk
359    return rows
360
361
362def export_speakers_csv(speakers):363    headers = [
364        'Speaker Name',
365        'Speaker Email',
export_sessions_csv has a cyclomatic complexity of 23 with "high" risk
229    return virtual_check_in_times
230
231
232def export_sessions_csv(sessions):233    headers = [
234        'Session Title',
235        'Session Starts At',
export_orders_csv has a cyclomatic complexity of 25 with "high" risk
 10from app.models.user_check_in import VirtualCheckIn
 11
 12
 13def export_orders_csv(orders): 14    headers = [
 15        'Order#',
 16        'Order Date',
UserDetail.before_update_object has a cyclomatic complexity of 24 with "high" risk
271            else:
272                view_kwargs['id'] = None
273
274    def before_update_object(self, user, data, view_kwargs):275        # TODO: Make a celery task for this
276        # if data.get('avatar_url') and data['original_image_url'] != user.original_image_url:
277        #     try:
UserDetail.before_get_object has a cyclomatic complexity of 33 with "very-high" risk
127        else:
128            self.schema = UserSchemaPublic
129
130    def before_get_object(self, view_kwargs):131        """
132        before get method for user object
133        :param view_kwargs: