<commit_before>﻿var Controls = function (console) {
    "use strict";

    var codeStore,
        validMethodsAndTypes = [],
        validMethodsAndTypesElement,
        sourceNameElement,
        destinationNameElement,
        writeUrlState = function () {
            var selectedIndex = codeStore.getGraphs().selectedSolution.getIndex(),
                query;
            if (selectedIndex < 0) {
                selectedIndex = 0;
            }

            query = "?from=" + encodeURIComponent(sourceNameElement.value) +
                "&to=" + encodeURIComponent(destinationNameElement.value);

            if (query !== document.location.search) {
                history.pushState(null, null, query);
            }
        },
        nameToIds = function (name) {
            var normalize = function (str) {
                    return str.toLowerCase().trim();
                },
                normalizedName = normalize(name),
                entries = validMethodsAndTypes.filter(function (entry) {
                    return -1 !== normalize(entry.name).indexOf(normalizedName);
                }).sort(function (left, right) { return left.name.length - right.name.length; });

            return entries.map(function (entry) { return entry.node.id; });
        },
        normalizeNameControls = function () {
            var startNodeText = sourceNameElement.value,
                endNodeText = destinationNameElement.value,
                startNodeIds,
                endNodeIds,
                idToNode,
		idToName;

            codeStore.getGraphs().solutions.splice(0, codeStore.getGraphs().solutions.length);
            codeStore.getGraphs().visualGraph.getNodes().forEach(function (node) {
                node.data.selected = false;
            });

            idToNode = codeStore.getGraphs().dataGraph.getNodeById.bind(codeStore.getGraphs().dataGraph);
	    idToName = function(id) {
                return codeStore.getGraphs().dataGraph.getNodeById(id).data.name;
            };<commit_msg>Don't require both text fields filled<commit_after>﻿var Controls = function (console) {
    "use strict";

    var codeStore,
        validMethodsAndTypes = [],
        validMethodsAndTypesElement,
        sourceNameElement,
        destinationNameElement,
        writeUrlState = function () {
            var selectedIndex = codeStore.getGraphs().selectedSolution.getIndex(),
                query;
            if (selectedIndex < 0) {
                selectedIndex = 0;
            }

            query = "?from=" + encodeURIComponent(sourceNameElement.value) +
                "&to=" + encodeURIComponent(destinationNameElement.value);

            if (query !== document.location.search) {
                history.pushState(null, null, query);
            }
        },
        nameToIds = function (name) {
            var normalize = function (str) {
                    return str.toLowerCase().trim();
                },
                normalizedName = normalize(name),
                entries = validMethodsAndTypes.filter(function (entry) {
                    return -1 !== normalize(entry.name).indexOf(normalizedName);
                }).sort(function (left, right) { return left.name.length - right.name.length; });

            return entries.map(function (entry) { return entry.node.id; });
        },
        normalizeNameControls = function () {
            var startNodeText = sourceNameElement.value,
                endNodeText = destinationNameElement.value,
                startNodeIds = [],
                endNodeIds = [],
                idToNode,
		idToName;

            codeStore.getGraphs().solutions.splice(0, codeStore.getGraphs().solutions.length);
            codeStore.getGraphs().visualGraph.getNodes().forEach(function (node) {
                node.data.selected = false;
            });

            idToNode = codeStore.getGraphs().dataGraph.getNodeById.bind(codeStore.getGraphs().dataGraph);
	    idToName = function(id) {
                return codeStore.getGraphs().dataGraph.getNodeById(id).data.name;
            };
{'fraction_non_alphanumeric': 0.10983365949119374, 'fraction_numerical': 0.0019569471624266144, 'mean_word_length': 1.883638928067701, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5271661', 'n_tokens_mistral': 1060, 'n_tokens_neox': 1012, 'n_words': 175}