<commit_before>((w) => {
  w.BoardsStore = {
    state: {
      lists: [],
      filters: {
        author_id: null,
        assignee_id: null,
        milestone_title: null,
        label_name: []
      }
    },
    reset: function () {
      this.state.lists = [];
      this.state.filters = {
        author: {},
        assignee: {},
        milestone: {},
        label: []
      };
    },
    new: function (board, persist = true) {
      const doneList = this.getDoneList(),
            list = new List(board);
      this.state.lists.push(list);

      if (persist) {
        list.save();
        this.removeBlankState();
        this.addBlankState();
      }

      return list;
    },
    shouldAddBlankState: function () {
      // Decide whether to add the blank state
      let addBlankState = true;

      this.state.lists.forEach(function (list) {
        if (list.type !== 'backlog' && list.type !== 'done') {
          addBlankState = false;
          return;
        }
      });
      return addBlankState;
    },
    addBlankState: function () {
      if ($.cookie('issue_board_welcome_hidden') === 'true') return;

      const doneList = this.getDoneList(),
            addBlankState = this.shouldAddBlankState();

      if (addBlankState) {
        this.new({
          id: 'blank',
          list_type: 'blank',
          title: 'Welcome to your Issue Board!',
          position: 0
        }, false);
      }
    },
    removeBlankState: function () {
      if ($.cookie('issue_board_welcome_hidden') === 'true') return;
      this.removeList('blank');

      $.cookie('issue_board_welcome_hidden', 'true', {
        expires: 365 * 10
      });
    },
    getDoneList: function () {
      return this.findList('type', 'done');
    },
    removeList: function (id) {
      const list = this.findList('id', id);
      list.destroy();

      this.state.lists = _.reject(this.state.lists, (list) => {
        return list.id === id;
      });
    },
    moveList: function (oldIndex, newIndex) {
      const listFrom = this.findList('position', oldIndex),
            listTo = this.findList('position', newIndex);

      listFrom.position = newIndex;
      if (newIndex > listTo.position) {
        listTo.position--;
      } else {
        listTo.position++;
      }

      listFrom.update();
    },
    moveCardToList: function (listFromId, listToId, issueId) {
      const listFrom = this.findList('id', listFromId),
            listTo = this.findList('id', listToId),
            issueTo = listTo.findIssue(issueId);
      let issue = listFrom.findIssue(issueId);<commit_msg>Fixed JS error when trying to remove list that wasnt defined<commit_after>((w) => {
  w.BoardsStore = {
    state: {
      lists: [],
      filters: {
        author_id: null,
        assignee_id: null,
        milestone_title: null,
        label_name: []
      }
    },
    reset: function () {
      this.state.lists = [];
      this.state.filters = {
        author: {},
        assignee: {},
        milestone: {},
        label: []
      };
    },
    new: function (board, persist = true) {
      const doneList = this.getDoneList(),
            list = new List(board);
      this.state.lists.push(list);

      if (persist) {
        list.save();
        this.removeBlankState();
        this.addBlankState();
      }

      return list;
    },
    shouldAddBlankState: function () {
      // Decide whether to add the blank state
      let addBlankState = true;

      this.state.lists.forEach(function (list) {
        if (list.type !== 'backlog' && list.type !== 'done') {
          addBlankState = false;
          return;
        }
      });
      return addBlankState;
    },
    addBlankState: function () {
      if ($.cookie('issue_board_welcome_hidden') === 'true') return;

      const doneList = this.getDoneList(),
            addBlankState = this.shouldAddBlankState();

      if (addBlankState) {
        this.new({
          id: 'blank',
          list_type: 'blank',
          title: 'Welcome to your Issue Board!',
          position: 0
        }, false);
      }
    },
    removeBlankState: function () {
      if ($.cookie('issue_board_welcome_hidden') === 'true') return;
      this.removeList('blank');

      $.cookie('issue_board_welcome_hidden', 'true', {
        expires: 365 * 10
      });
    },
    getDoneList: function () {
      return this.findList('type', 'done');
    },
    removeList: function (id) {
      const list = this.findList('id', id);

      if (!list) return;

      list.destroy();

      this.state.lists = _.reject(this.state.lists, (list) => {
        return list.id === id;
      });
    },
    moveList: function (oldIndex, newIndex) {
      const listFrom = this.findList('position', oldIndex),
            listTo = this.findList('position', newIndex);

      listFrom.position = newIndex;
      if (newIndex > listTo.position) {
        listTo.position--;
      } else {
        listTo.position++;
      }

      listFrom.update();
    },
    moveCardToList: function (listFromId, listToId, issueId) {
      const listFrom = this.findList('id', listFromId),
            listTo = this.findList('id', listToId),
            issueTo = listTo.findIssue(issueId);
      let issue = listFrom.findIssue(issueId);
{'fraction_non_alphanumeric': 0.14318268135206988, 'fraction_numerical': 0.002278769464489176, 'mean_word_length': 1.989216799091941, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '133562', 'n_tokens_mistral': 1628, 'n_tokens_neox': 1583, 'n_words': 328}