<commit_before>import { combineReducers } from "redux";

import { keccak256 } from "lib/helpers";

import * as actions from "./actions";

const DEFAULT_SOURCES = {
  byId: {}
};

function sources(state = DEFAULT_SOURCES, action) {
  switch (action.type) {
    /*
     * Adding a new source
     */
    case actions.ADD_SOURCE:
      let { ast, source, sourcePath, compiler } = action;

      let id = Object.keys(state.byId).length;

      return {
        byId: {
          ...state.byId,

          [id]: {
            id,
            ast,
            source,
            sourcePath,
            compiler
          }
        }
      };

    /*
     * Default case
     */
    default:
      return state;
  }
}

const DEFAULT_SOURCEMAPS = {
  byContext: {}
};

function sourceMaps(state = DEFAULT_SOURCEMAPS, action) {
  switch (action.type) {
    /*
     * Adding a new sourceMap
     */
    case actions.ADD_SOURCEMAP:
      let { binary, sourceMap } = action;
      let context = keccak256(binary);

      return {
        byContext: {
          ...state.byContext,

          [context]: {
            context,
            sourceMap
          }
        }
      };

    /*
     * Default Case
     */
    default:
      return state;
  }
}

const info = combineReducers({
  sources,
  sourceMaps
});

export function functionDepth(state = 1, action) {
  switch (action.type) {
    case actions.JUMP:
      const delta = spelunk(action.jumpDirection);
      return state + delta;

    case actions.RESET:
      return 1;
<commit_msg>Changing default function depth to 0 to keep the output more similar to the old output.<commit_after>import { combineReducers } from "redux";

import { keccak256 } from "lib/helpers";

import * as actions from "./actions";

const DEFAULT_SOURCES = {
  byId: {}
};

function sources(state = DEFAULT_SOURCES, action) {
  switch (action.type) {
    /*
     * Adding a new source
     */
    case actions.ADD_SOURCE:
      let { ast, source, sourcePath, compiler } = action;

      let id = Object.keys(state.byId).length;

      return {
        byId: {
          ...state.byId,

          [id]: {
            id,
            ast,
            source,
            sourcePath,
            compiler
          }
        }
      };

    /*
     * Default case
     */
    default:
      return state;
  }
}

const DEFAULT_SOURCEMAPS = {
  byContext: {}
};

function sourceMaps(state = DEFAULT_SOURCEMAPS, action) {
  switch (action.type) {
    /*
     * Adding a new sourceMap
     */
    case actions.ADD_SOURCEMAP:
      let { binary, sourceMap } = action;
      let context = keccak256(binary);

      return {
        byContext: {
          ...state.byContext,

          [context]: {
            context,
            sourceMap
          }
        }
      };

    /*
     * Default Case
     */
    default:
      return state;
  }
}

const info = combineReducers({
  sources,
  sourceMaps
});

export function functionDepth(state = 0, action) {
  switch (action.type) {
    case actions.JUMP:
      const delta = spelunk(action.jumpDirection);
      return state + delta;

    case actions.RESET:
      return 1;

{'fraction_non_alphanumeric': 0.10966306420851875, 'fraction_numerical': 0.00540368722186904, 'mean_word_length': 1.7294015611448394, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7653774', 'n_tokens_mistral': 986, 'n_tokens_neox': 958, 'n_words': 231}