def update_quality_game(self, task):
        previous = Tasks.find_one({
            'commit.branch': task['commit']['branch'],
            'created': {'$lt': task['created']},
        })
        if not previous:
            return

        game = self._get_or_create_quality_game()
        game['total'] = self._update_quality_object(
            game['total'], task,
            task.get('success_percent', 0) >=
            previous.get('success_percent', 0),
        )
        for violation in task['violations']:
            is_better = violation.get('success_percent', 0) >=\
                self._get_violation_success_percent(task, violation['name'])
            game['violations'][violation['name']] =\
                self._update_quality_object(
                    game['violations'].get(violation['name'], {}), task,
                    is_better,
                )
        QualityGame.save(game)
Update Entry.pingback_count when a pingback was posted.
dataset/ETHPy150Open nvbn/coviolations_web/projects/models.py/Project.update_quality_game--crossover with--dataset/ETHPy150Open Fantomas42/django-blog-zinnia/zinnia/signals.py/count_pingbacks_handler