<commit_before>import _ from 'lodash';

import React, { Component } from 'react';
import PropTypes from 'prop-types';

import { StyleSheet, Text, View } from 'react-native';

import Star from './components/Star'

export default class TapRating extends Component {
  static defaultProps = {
    defaultRating: 3,
    reviews: ["Terrible", "Bad", "Okay", "Good", "Great"],
    count: 5,
    showRating: true,
    reviewColor: 'rgba(230, 196, 46, 1)',
    reviewSize: 25
  };

  static getDerivedStateFromProps( nextProps, prevState ) {
    const { defaultRating } = nextProps;

    if ( defaultRating !== prevState.defaultRating ) {
      return {
        position: defaultRating,
        defaultRating
      }
    }

return null;
  }

  constructor() {
    super()

    this.state = {
      position: 5
    }
  }

  componentDidMount() {
    const { defaultRating } = this.props

    this.setState( { position: defaultRating } )
  }

  renderStars( rating_array ) {
    return _.map( rating_array, ( star, index ) => {
      return star
    } )
  }

  starSelectedInPosition( position ) {
    const { onFinishRating } = this.props

    if ( typeof onFinishRating === 'function' ) {onFinishRating( position );}

    this.setState( { position } )<commit_msg>Lint fixes on TapRating<commit_after>import _ from 'lodash';

import { Component } from 'react';

import { StyleSheet, Text, View } from 'react-native';

import Star from './components/Star'

export default class TapRating extends Component {
  static defaultProps = {
    defaultRating: 3,
    reviews: ["Terrible", "Bad", "Okay", "Good", "Great"],
    count: 5,
    showRating: true,
    reviewColor: 'rgba(230, 196, 46, 1)',
    reviewSize: 25
  };

  static getDerivedStateFromProps( nextProps, prevState ) {
    const { defaultRating } = nextProps;

    if ( defaultRating !== prevState.defaultRating ) {
      return {
        position: defaultRating,
        defaultRating
      }
    }

return null;
  }

  constructor() {
    super()

    this.state = {
      position: 5
    }
  }

  componentDidMount() {
    const { defaultRating } = this.props

    this.setState( { position: defaultRating } )
  }

  renderStars( rating_array ) {
    return _.map( rating_array, star => {
      return star
    } )
  }

  starSelectedInPosition( position ) {
    const { onFinishRating } = this.props

    if ( typeof onFinishRating === 'function' ) {
      onFinishRating( position );
    }

    this.setState( { position } )
{'fraction_non_alphanumeric': 0.12106537530266344, 'fraction_numerical': 0.011299435028248588, 'mean_word_length': 2.8434108527131783, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2708542', 'n_tokens_mistral': 822, 'n_tokens_neox': 739, 'n_words': 195}