<commit_before>(function () {
  'use strict';

  angular.module('app.core')
    .provider('baSidebarService', BaSidebarServiceProvider);

  function BaSidebarServiceProvider() {
    var staticMenuItems = [];

    this.addStaticItem = function () {
      staticMenuItems.push.apply(staticMenuItems, arguments);
    };

    /** @ngInject */
    this.$get = function ($state, layoutSizes) {
      return new _factory();

      function _factory() {
        var isMenuCollapsed = shouldMenuBeCollapsed();

        this.getMenuItems = function () {
          var states = defineMenuItemStates();
          var menuItems = states.filter(function (item) {
            return item.level === 0;
          });

          menuItems.forEach(function (item) {
            var children = states.filter(function (child) {
              return child.level === 1 && child.name.indexOf(item.name) === 0;
            });
            item.subMenu = children.length ? children : null;
          });

          return menuItems.concat(staticMenuItems);
        };

        this.shouldMenuBeCollapsed = shouldMenuBeCollapsed;
        this.canSidebarBeHidden = canSidebarBeHidden;

        this.setMenuCollapsed = function (isCollapsed) {
          isMenuCollapsed = isCollapsed;
        };

        this.isMenuCollapsed = function () {
          return isMenuCollapsed;
        };

        this.toggleMenuCollapsed = function () {
          isMenuCollapsed = !isMenuCollapsed;
        };

        this.getAllStateRefsRecursive = function (item) {
          var result = [];
          _iterateSubItems(item);
          return result;

          function _iterateSubItems(currentItem) {
            currentItem.subMenu && currentItem.subMenu.forEach(function (subItem) {
              subItem.stateRef && result.push(subItem.stateRef);
              _iterateSubItems(subItem);
            });
          }
        };

        function defineMenuItemStates() {
          return $state.get()
            .filter(function (s) {
              return s.sidebarMeta;
            })
            .map(function (s) {
              var meta = s.sidebarMeta;
              return {
                name: s.name,
                title: s.title,
                level: (s.name.match(/\./g) || []).length,
                order: meta.order,
                icon: meta.icon,
                stateRef: s.name
              };
            })
            .sort(function (a, b) {
              return (a.level - b.level) * 100 + a.order - b.order;
            });
        }

        function shouldMenuBeCollapsed() {
          return window.innerWidth <= layoutSizes.resWidthCollapseSidebar;
        }

        function canSidebarBeHidden() {
          return window.innerWidth <= layoutSizes.resWidthHideSidebar;
        }
      }

    };

  }
})();<commit_msg>변수 변경<commit_after>(function () {
  'use strict';

  angular.module('app.core')
    .provider('baSidebarService', BaSidebarServiceProvider);

  function BaSidebarServiceProvider() {
    var staticMenuItems = [];

    this.addStaticItem = function () {
      staticMenuItems.push.apply(staticMenuItems, arguments);
    };

    function get($state, layoutSizes) {
      return new _factory();

      function _factory() {
        var isMenuCollapsed = shouldMenuBeCollapsed();

        this.getMenuItems = function () {
          var states = defineMenuItemStates();
          var menuItems = states.filter(function (item) {
            return item.level === 0;
          });

          menuItems.forEach(function (item) {
            var children = states.filter(function (child) {
              return child.level === 1 && child.name.indexOf(item.name) === 0;
            });
            item.subMenu = children.length ? children : null;
          });

          return menuItems.concat(staticMenuItems);
        };

        this.shouldMenuBeCollapsed = shouldMenuBeCollapsed;
        this.canSidebarBeHidden = canSidebarBeHidden;

        this.setMenuCollapsed = function (isCollapsed) {
          isMenuCollapsed = isCollapsed;
        };

        this.isMenuCollapsed = function () {
          return isMenuCollapsed;
        };

        this.toggleMenuCollapsed = function () {
          isMenuCollapsed = !isMenuCollapsed;
        };

        this.getAllStateRefsRecursive = function (item) {
          var result = [];
          _iterateSubItems(item);
          return result;

          function _iterateSubItems(currentItem) {
            currentItem.subMenu && currentItem.subMenu.forEach(function (subItem) {
              subItem.stateRef && result.push(subItem.stateRef);
              _iterateSubItems(subItem);
            });
          }
        };

        function defineMenuItemStates() {
          return $state.get()
            .filter(function (sidebar) {
              return sidebar.sidebarMeta;
            })
            .map(function (sidebar) {
              var meta = sidebar.sidebarMeta;
              return {
                name: sidebar.name,
                title: sidebar.title,
                level: (sidebar.name.match(/\./g) || []).length,
                order: meta.order,
                icon: meta.icon,
                stateRef: sidebar.name
              };
            })
            .sort(function (item1, item2) {
              return (item1.level - item2.level) * 100 + item1.order - item2.order;
            });
        }

        function shouldMenuBeCollapsed() {
          return window.innerWidth <= layoutSizes.resWidthCollapseSidebar;
        }

        function canSidebarBeHidden() {
          return window.innerWidth <= layoutSizes.resWidthHideSidebar;
        }
      }

    }

    this.$get = get;
  }
})();
{'fraction_non_alphanumeric': 0.11036906854130053, 'fraction_numerical': 0.003163444639718805, 'mean_word_length': 1.751934235976789, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3224782', 'n_tokens_mistral': 1550, 'n_tokens_neox': 1488, 'n_words': 271}