<commit_before>package scrum.client.project;

import java.util.ArrayList;
import java.util.List;

public class EstimationBarFactory {

	public static void createEstimationBars(List<Requirement> requirements, Integer velocity) {
		int sprintOffset = 0;
		float remainingWorkInSprint = velocity == null ? 0 : velocity;
		List<Float> workPerSprint;
		boolean stop = false;
		for (Requirement requirement : requirements) {
			workPerSprint = new ArrayList<Float>();

			Float estimatedWork = requirement.getEstimatedWork();
			if (estimatedWork == null && !stop) {
				stop = true;
				sprintOffset++;
			}

			if (velocity == null || velocity == 0 || estimatedWork == null) {
				if (estimatedWork != null) workPerSprint.add(estimatedWork);
				requirement.setEstimationBar(new EstimationBar(sprintOffset, workPerSprint));
				continue;
			}
			float work = estimatedWork;
			while (work > remainingWorkInSprint) {
				workPerSprint.add(remainingWorkInSprint);
				work -= remainingWorkInSprint;
				if (!stop) sprintOffset++;
				remainingWorkInSprint = velocity;
			}
			if (work > 0) {
				workPerSprint.add(work);
				remainingWorkInSprint -= work;
			}
			requirement.setEstimationBar(new EstimationBar(sprintOffset - workPerSprint.size() + 1, workPerSprint));
			if (remainingWorkInSprint == 0) {
				if (!stop) sprintOffset++;
				remainingWorkInSprint = velocity;
			}
		}

	}
}
<commit_msg>sto166 disable estimation bar coloring and projection bars when velocity missing<commit_after>package scrum.client.project;

import java.util.ArrayList;
import java.util.List;

public class EstimationBarFactory {

	public static void createEstimationBars(List<Requirement> requirements, Integer velocity) {
		int sprintOffset = 0;
		float remainingWorkInSprint = velocity == null ? 0 : velocity;
		List<Float> workPerSprint;
		boolean stop = false;
		for (Requirement requirement : requirements) {
			Float estimatedWork = requirement.getEstimatedWork();
			workPerSprint = new ArrayList<Float>();
			if (velocity == null || velocity == 0) {
				if (estimatedWork != null) workPerSprint.add(estimatedWork);
				requirement.setEstimationBar(new EstimationBar(0, workPerSprint));
				continue;
			}

			if (estimatedWork == null && !stop) {
				stop = true;
				sprintOffset++;
			}

			if (estimatedWork == null) {
				requirement.setEstimationBar(new EstimationBar(sprintOffset, workPerSprint));
				continue;
			}
			float work = estimatedWork;
			while (work > remainingWorkInSprint) {
				workPerSprint.add(remainingWorkInSprint);
				work -= remainingWorkInSprint;
				if (!stop) sprintOffset++;
				remainingWorkInSprint = velocity;
			}
			if (work > 0) {
				workPerSprint.add(work);
				remainingWorkInSprint -= work;
			}
			requirement.setEstimationBar(new EstimationBar(sprintOffset - workPerSprint.size() + 1, workPerSprint));
			if (remainingWorkInSprint == 0) {
				if (!stop) sprintOffset++;
				remainingWorkInSprint = velocity;
			}
		}

	}
}

{'fraction_non_alphanumeric': 0.10757780784844384, 'fraction_numerical': 0.005412719891745603, 'mean_word_length': 4.187719298245614, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '3870393', 'n_tokens_mistral': 1080, 'n_tokens_neox': 898, 'n_words': 205}