docs: def quality(self):
          """Return a dict filled with metrics related to the inner
  
          quality of the dataset:
  
              * number of tags
              * description length
              * and so on
          """
          from udata.models import Discussion  # noqa: Prevent circular imports
          result = {}
          if not self.id:
              # Quality is only relevant on saved Datasets
              return result
          if self.next_update:
              result['frequency'] = self.frequency
              result['update_in'] = -(self.next_update - datetime.now()).days
          if self.tags:
              result['tags_count'] = len(self.tags)
          if self.description:
              result['description_length'] = len(self.description)
          if self.resources:
              result['has_resources'] = True
              result['has_only_closed_or_no_formats'] = all(
                  resource.closed_or_no_format for resource in self.resources)
              result['has_unavailable_resources'] = not all(
                  self.check_availability())
          discussions = Discussion.objects(subject=self)
          if discussions:
              result['discussions'] = len(discussions)
              result['has_untreated_discussions'] = not all(
                  discussion.person_involved(self.owner)
                  for discussion in discussions)
          result['score'] = self.compute_quality_score(result)
          return result