<commit_before>package ru.gildedrose;

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

public class GildedRose {

    public static void main(String[] args) {

        System.out.println("OMGHAI!");

        List<Item> items = new ArrayList<Item>();
        items.add(new Item("+5 Dexterity Vest", 10, 20));
        items.add(new Item("Aged Brie", 2, 0));
        items.add(new Item("Elixir of the Mongoose", 5, 7));
        items.add(new Item("Sulfuras, Hand of Ragnaros", 0, 80));
        items.add(new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20));
        items.add(new Item("Conjured Mana Cake", 3, 6));

        for (int i = 0; i < 100; i++) {
            printItems(updateQuality(items));
        }
    }

    private static void printItems(List<Item> items) {
        for (Item item : items) {
            printItem(item);
        }
        System.out.println("---------------------");
    }

    public static void printItem(Item item) {
        System.out.println(item.getName() + " " + item.getSellIn() + " " + item.getQuality());
    }

    public static List<Item> updateQuality(List<Item> items) {
        for (Item item : items) {
            if (item.getName().equals("Sulfuras, Hand of Ragnaros")) continue;
            item.setSellIn(item.getSellIn() - 1);
        }

        for (Item item : items) {
            if (item.getName().equals("Aged Brie")) {
                increaseQuality(item);

                if (item.getSellIn() < 0) {
                    increaseQuality(item);
                }
            } else if (item.getName().equals("Backstage passes to a TAFKAL80ETC concert")) {
                increaseQuality(item);

                if (item.getSellIn() < 0) {
                    resetQuality(item);
                } else if (item.getSellIn() < 5) {
                    increaseQuality(item);
                    increaseQuality(item);
                } else if (item.getSellIn() < 10) {
                    increaseQuality(item);
                }
            } else if (item.getName().equals("Sulfuras, Hand of Ragnaros")) {
                // do nothing
            } else {
                decreaseQuality(item);
                if (item.getSellIn() < 0) {
                    decreaseQuality(item);
                }
            }

        }
        return items;
    }

    private static void resetQuality(Item item) {
        item.setQuality(0);
    }

    private static void decreaseQuality(Item item) {
        if (item.getQuality() <= 0) return;
        item.setQuality(item.getQuality() - 1);
    }

    private static void increaseQuality(Item item) {
        if (item.getQuality() >= 50) return;
        item.setQuality(item.getQuality() + 1);
    }

}<commit_msg>gilded rose kata<commit_after>package ru.gildedrose;

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

public class GildedRose {

    public static void main(String[] args) {

        System.out.println("OMGHAI!");

        List<Item> items = new ArrayList<Item>();
        items.add(new Item("+5 Dexterity Vest", 10, 20));
        items.add(new Item("Aged Brie", 2, 0));
        items.add(new Item("Elixir of the Mongoose", 5, 7));
        items.add(new Item("Sulfuras, Hand of Ragnaros", 0, 80));
        items.add(new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20));
        items.add(new Item("Conjured Mana Cake", 3, 6));

        for (int i = 0; i < 100; i++) {
            printItems(updateQuality(items));
        }
    }

    private static void printItems(List<Item> items) {
        for (Item item : items) {
            printItem(item);
        }
        System.out.println("---------------------");
    }

    public static void printItem(Item item) {
        System.out.println(item.getName() + " " + item.getSellIn() + " " + item.getQuality());
    }

    public static List<Item> updateQuality(List<Item> items) {
        for (Item item : items) {
            if (item.getName().equals("Sulfuras, Hand of Ragnaros")) continue;
            item.setSellIn(item.getSellIn() - 1);
        }

        for (Item item : items) {
            if (item.getName().equals("Aged Brie")) {
                if (item.getSellIn() < 0) {
                    increaseQuality(item);
                    increaseQuality(item);
                } else {
                    increaseQuality(item);
                }
            } else if (item.getName().equals("Backstage passes to a TAFKAL80ETC concert")) {
                if (item.getSellIn() < 0) {
                    resetQuality(item);
                } else if (item.getSellIn() < 5) {
                    increaseQuality(item);
                    increaseQuality(item);
                    increaseQuality(item);
                } else if (item.getSellIn() < 10) {
                    increaseQuality(item);
                    increaseQuality(item);
                } else {
                    increaseQuality(item);
                }
            } else if (item.getName().equals("Sulfuras, Hand of Ragnaros")) {
                // do nothing
            } else {
                if (item.getSellIn() < 0) {
                    decreaseQuality(item);
                    decreaseQuality(item);
                } else {
                    decreaseQuality(item);
                }
            }

        }
        return items;
    }

    private static void resetQuality(Item item) {
        item.setQuality(0);
    }

    private static void decreaseQuality(Item item) {
        if (item.getQuality() <= 0) return;
        item.setQuality(item.getQuality() - 1);
    }

    private static void increaseQuality(Item item) {
        if (item.getQuality() >= 50) return;
        item.setQuality(item.getQuality() + 1);
    }

}
{'fraction_non_alphanumeric': 0.134125043660496, 'fraction_numerical': 0.013622074746769124, 'mean_word_length': 1.6563079777365493, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 15, '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': '4253627', 'n_tokens_mistral': 1796, 'n_tokens_neox': 1623, 'n_words': 375}