<commit_before>module Camel {
    export function CamelController($scope, workspace:Workspace) {
      $scope.workspace = workspace;
      $scope.routes = [];

      $scope.$watch('workspace.selection', function () {
        if (workspace.moveIfViewInvalid()) return;

        $scope.mbean = getSelectionCamelContextMBean(workspace);
        if ($scope.mbean) {
          var jolokia = workspace.jolokia;
          jolokia.request(
                  {type: 'exec', mbean: $scope.mbean, operation: 'dumpRoutesAsXml()'},
                  onSuccess(populateTable));
        }
      });

      var populateTable = function (response) {
        var data = response.value;
        $scope.routes = data;
        $scope.nodes = {};
        var nodes = [];
        var links = [];
        var selectedRouteId = null;
        var selection = workspace.selection;
        if (selection) {
          if (selection && selection.entries) {
            var typeName = selection.entries["type"];
            var name = selection.entries["name"];
            if ("routes" === typeName && name) {
              selectedRouteId = trimQuotes(name);
            }
          }
        }
        if (data) {
          var doc = $.parseXML(data);
          var allRoutes = $(doc).find("route");

          var canvasDiv = $('#canvas');
          var width = canvasDiv.width();
          var height = canvasDiv.height();
          if (height < 300) {
            console.log("browse thinks the height is only " + height + " so calculating offset from doc height");
            height = $(document).height() - canvasDiv.offset()['top'] - 5;
          }
          //console.log("Using width " + width + " and height " + height);

          var delta = 150;

          function addChildren(parent, parentId, parentX, parentY, parentNode = null) {
            var x = parentX;
            var y = parentY + delta;
            var rid = parent.getAttribute("id");
            $(parent).children().each((idx, route) => {
              var id = nodes.length;<commit_msg>avoid possible exception on openshift<commit_after>module Camel {
    export function CamelController($scope, workspace:Workspace) {
      $scope.workspace = workspace;
      $scope.routes = [];

      $scope.$watch('workspace.selection', function () {
        if (workspace.moveIfViewInvalid()) return;

        $scope.mbean = getSelectionCamelContextMBean(workspace);
        if ($scope.mbean) {
          var jolokia = workspace.jolokia;
          jolokia.request(
                  {type: 'exec', mbean: $scope.mbean, operation: 'dumpRoutesAsXml()'},
                  onSuccess(populateTable));
        }
      });

      var populateTable = function (response) {
        var data = response.value;
        $scope.routes = data;
        $scope.nodes = {};
        var nodes = [];
        var links = [];
        var selectedRouteId = null;
        var selection = workspace.selection;
        if (selection) {
          if (selection && selection.entries) {
            var typeName = selection.entries["type"];
            var name = selection.entries["name"];
            if ("routes" === typeName && name) {
              selectedRouteId = trimQuotes(name);
            }
          }
        }
        if (data) {
          var doc = $.parseXML(data);
          var allRoutes = $(doc).find("route");

          var canvasDiv = $('#canvas');
          var width = canvasDiv.width();
          var height = canvasDiv.height();
          if (height < 300) {
            console.log("browse thinks the height is only " + height + " so calculating offset from doc height");
            var offset = canvasDiv.offset();
            height = $(document).height() - 5;
            if (offset) {
              var top = offset['top'];
              if (top) {
                height -= top;
              }
            }
          }
          //console.log("Using width " + width + " and height " + height);

          var delta = 150;

          function addChildren(parent, parentId, parentX, parentY, parentNode = null) {
            var x = parentX;
            var y = parentY + delta;
            var rid = parent.getAttribute("id");
            $(parent).children().each((idx, route) => {
              var id = nodes.length;
{'fraction_non_alphanumeric': 0.1288056206088993, 'fraction_numerical': 0.003278688524590164, 'mean_word_length': 1.7805989583333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7550908', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1110, 'n_words': 282}