<commit_before>import React from 'react/addons';
import Section from './Section';

/*
 * @class Course
 * @extends React.Component
 */
class Course extends React.Component {

  /*
   * @method shouldComponentUpdate
   * @returns {Boolean}
   */
  shouldComponentUpdate () {
    return React.addons.PureRenderMixin.shouldComponentUpdate.apply(this, arguments);
  }

  /*
   * @method render
   * @returns {JSX}
   */
  render () {
    var sections = this.props.course.sections.map(function(section) {
      return (
        <Section key={section.id} section={section} />
      )
    });

    return (
      <div className="panel panel-default">
        <div className="panel-heading">
          <h3 className="panel-title">
            {this.props.course.subject.subject_id} {this.props.course.catalog_number} - {this.props.course.title}
          </h3>
          <p>{this.props.course.description}</p>
        </div>
        <ul className="list-group">
          {sections}
        </ul>
      </div>
    );
  }
}

// Prop types validation<commit_msg>Abstracted the title creation into its own function<commit_after>import React from 'react/addons';
import Section from './Section';

/*
 * @class Course
 * @extends React.Component
 */
class Course extends React.Component {

  /*
   * @method shouldComponentUpdate
   * @returns {Boolean}
   */
  shouldComponentUpdate () {
    return React.addons.PureRenderMixin.shouldComponentUpdate.apply(this, arguments);
  }

  getCourseTitle() {
    return `${this.props.course.subject.subject_id} ${this.props.course.catalog_number} - ${this.props.course.title}`;
  }

  /*
   * @method render
   * @returns {JSX}
   */
  render () {
    var sections = this.props.course.sections.map(function(section) {
      return (
        <Section key={section.id} section={section} />
      )
    });

    return (
      <div className="panel panel-default">
        <div className="panel-heading">
          <h3 className="panel-title">
            {this.getCourseTitle()}
          </h3>
          <p>{this.props.course.description}</p>
        </div>
        <ul className="list-group">
          {sections}
        </ul>
      </div>
    );
  }
}

// Prop types validation
{'fraction_non_alphanumeric': 0.1463525147258722, 'fraction_numerical': 0.0018124150430448573, 'mean_word_length': 2.466248037676609, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '4484993', 'n_tokens_mistral': 666, 'n_tokens_neox': 660, 'n_words': 125}