<commit_before>module Osgi {

    export function ServiceDependencyController($scope, $routeParams, workspace:Workspace, osgiDataService: OsgiDataService) {

        $scope.init = () => {

            if ($routeParams["bundleFilter"]) {
                $scope = $routeParams["bundleFilter"];
            } else {
                $scope.bundleFilter = "";
            }

            if ($routeParams["pkgFilter"]) {
                $scope.packageFilter = $routeParams["pkgFilter"];
            } else {
                $scope.packageFilter = "";
            }

            if ($routeParams["view"] == "packages") {
                $scope.selectView = "packages";
            } else {
                $scope.selectView = "services";
            }

            if ($routeParams['hideUnused']) {
                $scope.hideUnused = $routeParams['hideUnused'] == "true";
            } else {
                $scope.hideUnused = true;
            }

            $scope.updatePkgFilter();
        }

        $scope.addToDashboardLink = () => {

            var routeParams = angular.toJson($routeParams);

            var href="#/osgi/dependencies";
            var title="OSGi Dependencies";

            var size = angular.toJson({
                size_x: 2,
                size_y: 2
            });
            return "#/dashboard/add?tab=dashboard" +
                "&href=" + encodeURIComponent(href) +
                "&routeParams=" + encodeURIComponent(routeParams) +
                "&size=" + encodeURIComponent(size) +
                "&title=" + encodeURIComponent(title);
        };

        $scope.$on('$routeUpdate', () => {
            $scope.init();
            $scope.updateGraph();
        });

        $scope.updateGraph = () => {

            var graphBuilder = new OsgiGraphBuilder(
              osgiDataService,
              $scope.bundleFilter,
              $scope.packageFilter,
              $scope.selectView == "services",
              $scope.selectView == "packages",
              $scope.hideUnused
            );

            $scope.graph = graphBuilder.buildGraph();
            Core.$apply($scope);
        };

        $scope.updatePkgFilter = () => {
            if ($scope.packageFilter == null || $scope.packageFilter == "") {
                $scope.selectView = "services";
                $scope.disablePkg = true;
            } else {
                $scope.disablePkg = false;
            }
        }

        $scope.init();
        $scope.updateGraph();
    }
}
<commit_msg>Passing routeParams from scope to routeParams object.<commit_after>module Osgi {

    export function ServiceDependencyController($scope, $routeParams, workspace:Workspace, osgiDataService: OsgiDataService) {

        $scope.init = () => {

            if ($routeParams["bundleFilter"]) {
                $scope = $routeParams["bundleFilter"];
            } else {
                $scope.bundleFilter = "";
            }

            if ($routeParams["pkgFilter"]) {
                $scope.packageFilter = $routeParams["pkgFilter"];
            } else {
                $scope.packageFilter = "";
            }

            if ($routeParams["view"] == "packages") {
                $scope.selectView = "packages";
            } else {
                $scope.selectView = "services";
            }

            if ($routeParams['hideUnused']) {
                $scope.hideUnused = $routeParams['hideUnused'] == "true";
            } else {
                $scope.hideUnused = true;
            }

            $scope.updatePkgFilter();
        }

        $scope.addToDashboardLink = () => {

            var routeParams = angular.toJson($routeParams);

            var href="#/osgi/dependencies";
            var title="OSGi Dependencies";

            var size = angular.toJson({
                size_x: 2,
                size_y: 2
            });

            var addLink = "#/dashboard/add?tab=dashboard" +
                "&href=" + encodeURIComponent(href) +
                "&routeParams=" + encodeURIComponent(routeParams) +
                "&size=" + encodeURIComponent(size) +
                "&title=" + encodeURIComponent(title);

            return addLink;
        };

        $scope.$on('$routeUpdate', () => {
            $scope.init();
            $scope.updateGraph();
        });

        $scope.updateGraph = () => {

            var graphBuilder = new OsgiGraphBuilder(
              osgiDataService,
              $scope.bundleFilter,
              $scope.packageFilter,
              $scope.selectView == "services",
              $scope.selectView == "packages",
              $scope.hideUnused
            );

            $routeParams["bundleFilter"]  = $scope.bundleFilter;
            $routeParams["packageFilter"] = $scope.packageFilter;
            $routeParams["hideUnused"]    = $scope.hideUnused ? "true" : "false";
            $routeParams["view"]          = $scope.selectView;

            $scope.graph = graphBuilder.buildGraph();
            Core.$apply($scope);
        };

        $scope.updatePkgFilter = () => {
            if ($scope.packageFilter == null || $scope.packageFilter == "") {
                $scope.selectView = "services";
                $scope.disablePkg = true;
            } else {
                $scope.disablePkg = false;
            }
        }

        $scope.init();
        $scope.updateGraph();
    }
}

{'fraction_non_alphanumeric': 0.13470828688219993, 'fraction_numerical': 0.0007432181345224824, 'mean_word_length': 1.4829335793357934, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5009520', 'n_tokens_mistral': 1437, 'n_tokens_neox': 1369, 'n_words': 215}