<commit_before>package io.gitlab.arturbosch.smartsmells.api

import groovy.transform.PackageScope
import io.gitlab.arturbosch.smartsmells.common.DetectionResult
import io.gitlab.arturbosch.smartsmells.config.Smell
import io.gitlab.arturbosch.smartsmells.smells.cycle.Cycle

/**
 * @author artur
 */
class SmellResult {

	private Map<Smell, List<DetectionResult>> smellSets

	@PackageScope
	SmellResult(Map<Smell, List<DetectionResult>> smellSets) {
		this.smellSets = smellSets
	}

	List<DetectionResult> of(Smell smell) {
		smellSets.getOrDefault(smell, new ArrayList<>())
	}

	List<DetectionResult> filter(String path) {
		return smellSets.values().stream()<commit_msg>Allow to create empty smell results<commit_after>package io.gitlab.arturbosch.smartsmells.api

import io.gitlab.arturbosch.smartsmells.common.DetectionResult
import io.gitlab.arturbosch.smartsmells.config.Smell
import io.gitlab.arturbosch.smartsmells.smells.cycle.Cycle

/**
 * @author artur
 */
class SmellResult {

	private Map<Smell, List<DetectionResult>> smellSets

	SmellResult(Map<Smell, List<DetectionResult>> smellSets = Collections.emptyMap()) {
		this.smellSets = smellSets
	}

	List<DetectionResult> of(Smell smell) {
		smellSets.getOrDefault(smell, new ArrayList<>())
	}

	List<DetectionResult> filter(String path) {
		return smellSets.values().stream()
{'fraction_non_alphanumeric': 0.11293941660433807, 'fraction_numerical': 0.0, 'mean_word_length': 6.079365079365079, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '376994', 'n_tokens_mistral': 470, 'n_tokens_neox': 454, 'n_words': 72}