<commit_before>import React from 'react';
import KeyValueList from '../interfaces/keyValueList';

const ExceptionMechanism = React.createClass({
  propTypes: {
    data: React.PropTypes.object.isRequired,
    platform: React.PropTypes.string,
  },

  renderMachException(data) {
    return ['Mach Exception', data.exception_name];
  },

  renderPosixSignal(data) {
    return ['Signal', data.name + ' (' + data.signal + ')'];
  },

  render() {
    let elements = [];

    if (this.props.data.mach_exception) {
      elements.push(this.renderMachException(this.props.data.mach_exception));
    }
    if (this.props.data.posix_signal) {
      elements.push(this.renderPosixSignal(this.props.data.posix_signal));
    }

    if (elements.length === 0) {
      return null;
    }

    return (
      <div className="exception-mechanism">
        <KeyValueList data={elements} />
      </div>
    );
  }
});

export default ExceptionMechanism;
<commit_msg>Render more info in the exception mechanism<commit_after>import React from 'react';
import KeyValueList from '../interfaces/keyValueList';

const ExceptionMechanism = React.createClass({
  propTypes: {
    data: React.PropTypes.object.isRequired,
    platform: React.PropTypes.string,
  },

  render() {
    let elements = [];

    if (this.props.data.mach_exception) {
      const {mach_exception} = this.props.data;
      if (mach_exception.exception_name) {
        elements.push(['Mach Exception', mach_exception.exception_name]);
      }
      if (mach_exception.code_name) {
        elements.push(['Mach Code', mach_exception.code_name]);
      }
    }
    if (this.props.data.posix_signal) {
      const {posix_signal} = this.props.data;
      elements.push(['Signal', posix_signal.name + ' (' + posix_signal.signal + ')']);
    }

    if (elements.length === 0) {
      return null;
    }

    return (
      <div className="exception-mechanism">
        <KeyValueList data={elements} />
      </div>
    );
  }
});

export default ExceptionMechanism;

{'fraction_non_alphanumeric': 0.14022874191944307, 'fraction_numerical': 0.000994530084535057, 'mean_word_length': 3.089430894308943, 'pattern_counts': {'":': 0, '<': 9, '<?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': '3231807', 'n_tokens_mistral': 641, 'n_tokens_neox': 629, 'n_words': 111}