code: def valid_result(self, r):
          '''
              Check if the result is valid
              A result is invalid if:
                  - All its source paths belong to the source path filtered
                  - Or a similar result was reported and saved during a previous run
          '''
          source_mapping_elements = [elem['source_mapping']['filename_absolute'] for elem in r['elements'] if 'source_mapping' in elem]
          if r['elements'] and all((any(path in src_mapping for path in self._paths_to_filter) for src_mapping in source_mapping_elements)):
              return False
          return not r['description'] in [pr['description'] for pr in self._previous_resultsf valid_result(self, r):
          '''
              Check if the result is valid
              A result is invalid if:
                  - All its source paths belong to the source path filtered
                  - Or a similar result was reported and saved during a previous run
          '''
          source_mapping_elements = [elem['source_mapping']['filename_absolute'] for elem in r['elements'] if 'source_mapping' in elem]
          if r['elements'] and all((any(path in src_mapping for path in self._paths_to_filter) for src_mapping in source_mapping_elements)):
              return False
          return not r['description'] in [pr['description'] for pr in self._previous_results]
docs: Check if the result is valid
              A result is invalid if:
                  - All its source paths belong to the source path filtered
                  - Or a similar result was reported and saved during a previous run