<commit_before>'use strict'

var React = require('react')
global.jQuery = require('jquery')
var ReactBootstrap = require('react-bootstrap')
var ListGroupItem = ReactBootstrap.ListGroupItem
var Button = ReactBootstrap.Button
var Glyphicon = ReactBootstrap.Glyphicon
var OverlayTrigger = ReactBootstrap.OverlayTrigger
var Popover = ReactBootstrap.Popover

var Rating = React.createClass({
  propTypes: {
    eventKey: React.PropTypes.number,
    measurement: React.PropTypes.object,
    assessId: React.PropTypes.string.isRequired,
    attribute: React.PropTypes.object,
    saveMeasurement: React.PropTypes.func.isRequired,
    rating: React.PropTypes.object
  },

  render: function () {
    var ratingActive = (this.props.measurement && this.props.measurement.rating) ? (this.props.measurement.rating === this.props.rating.id) : false
    var targetActive = (this.props.measurement && this.props.measurement.target_rating) ? (this.props.measurement.target_rating === this.props.rating.id) : false
    var targetBsStyle = targetActive ? 'success' : 'default'
    var descClass = (this.props.rating.desc_class ? ' ' + this.props.rating.desc_class : '') + (this.props.rating.colour ? ' rating-colour' : '')
    var ratingClick = this.props.saveMeasurement.bind(null, 'rating', this.props.rating.id)
    var targetClick = this.props.saveMeasurement.bind(null, 'target', this.props.rating.id)

    var header = (
      <div>
        <h4 className='inline clickable' onClick={ratingClick}>{this.props.rating.name}</h4>
        {(this.props.measurement && this.props.measurement.rating)
          ? <span>
            <Button ref='currentBtn' onClick={targetClick} bsStyle={targetBsStyle} className='target-btn' active={targetActive} bsSize='xsmall'>
              Target
            </Button>
            <OverlayTrigger trigger='click' placement='left' rootClose
              overlay={<Popover id={'rating-popover-' + this.props.rating.id}>You have decided your current rating. Set your future goal by selecting a target button.</Popover>}>
              <Glyphicon className='target-help clickable' glyph='question-sign' />
            </OverlayTrigger>
          </span>
          : undefined}
      </div>
    )

    return (
      <ListGroupItem active={ratingActive} key={this.props.rating.id} header={header} className={descClass} style={{'borderLeftColor': this.props.rating.colour}}>
        <div className='rating-desc clickable' onClick={ratingClick}>
          {this.props.rating.desc}
        </div>
      </ListGroupItem>
      )
  }
})

module.exports = Rating<commit_msg>Kill last bind complaint<commit_after>'use strict'

var React = require('react')
global.jQuery = require('jquery')
var ReactBootstrap = require('react-bootstrap')
var ListGroupItem = ReactBootstrap.ListGroupItem
var Button = ReactBootstrap.Button
var Glyphicon = ReactBootstrap.Glyphicon
var OverlayTrigger = ReactBootstrap.OverlayTrigger
var Popover = ReactBootstrap.Popover

var Rating = React.createClass({
  propTypes: {
    eventKey: React.PropTypes.number,
    measurement: React.PropTypes.object,
    assessId: React.PropTypes.string.isRequired,
    attribute: React.PropTypes.object,
    saveMeasurement: React.PropTypes.func.isRequired,
    rating: React.PropTypes.object
  },

  ratingClick: function () {
    this.props.saveMeasurement('rating', this.props.rating.id)
  },
  targetClick: function () {
    this.props.saveMeasurement('target', this.props.rating.id)
  },
  render: function () {
    var ratingActive = (this.props.measurement && this.props.measurement.rating) ? (this.props.measurement.rating === this.props.rating.id) : false
    var targetActive = (this.props.measurement && this.props.measurement.target_rating) ? (this.props.measurement.target_rating === this.props.rating.id) : false
    var targetBsStyle = targetActive ? 'success' : 'default'
    var descClass = (this.props.rating.desc_class ? ' ' + this.props.rating.desc_class : '') + (this.props.rating.colour ? ' rating-colour' : '')

    var header = (
      <div>
        <h4 className='inline clickable' onClick={this.ratingClick}>{this.props.rating.name}</h4>
        {(this.props.measurement && this.props.measurement.rating)
          ? <span>
            <Button onClick={this.targetClick} bsStyle={targetBsStyle} className='target-btn' active={targetActive} bsSize='xsmall'>
              Target
            </Button>
            <OverlayTrigger trigger='click' placement='left' rootClose
              overlay={<Popover id={'rating-popover-' + this.props.rating.id}>You have decided your current rating. Set your future goal by selecting a target button.</Popover>}>
              <Glyphicon className='target-help clickable' glyph='question-sign' />
            </OverlayTrigger>
          </span>
          : undefined}
      </div>
    )

    return (
      <ListGroupItem active={ratingActive} key={this.props.rating.id} header={header} className={descClass} style={{'borderLeftColor': this.props.rating.colour}}>
        <div className='rating-desc clickable' onClick={this.ratingClick}>
          {this.props.rating.desc}
        </div>
      </ListGroupItem>
      )
  }
})

module.exports = Rating
{'fraction_non_alphanumeric': 0.13269045323047252, 'fraction_numerical': 0.0007714561234329798, 'mean_word_length': 3.5332167832167833, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, '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': '6875820', 'n_tokens_mistral': 1506, 'n_tokens_neox': 1490, 'n_words': 285}