<commit_before>import React from 'react';

import Analyzer from 'Parser/Core/Analyzer';

import SPELLS from 'common/SPELLS';
import SpellLink from 'common/SpellLink';

import {formatPercentage} from 'common/format';
import StatisticBox from 'Main/StatisticBox';
import SpellIcon from 'common/SpellIcon';

const IMP_DURATION = 12;
const MILLISECONDS = 1000;

class DemEmpUptimeHoG extends Analyzer{
  unempowered_casts = [];
  hog_casts = 0;
  total_empowered_time = 0;

  get uptime(){
    return this.total_empowered_time / (this.hog_casts * IMP_DURATION * MILLISECONDS);
  }

  get suggestionThresholds(){
    return {
      actual: this.uptime,
      isLessThan: {
        minor: 0.95,
        average: 0.9,
        major: 0.8,
      },
      style: 'percentage',
    };
  }

  on_byPlayer_cast(event){
    const spellId = event.ability.guid;
    if(spellId === SPELLS.HAND_OF_GULDAN_CAST.id){
      this.hog_casts += 1;
      this.unempowered_casts.push(event.timestamp);
    } else if (spellId === SPELLS.DEMONIC_EMPOWERMENT.id){
      for(const i in this.unempowered_casts){
        const hog = this.unempowered_casts[i];
        if(event.timestamp - hog <= IMP_DURATION * MILLISECONDS){ //Imps are still active from this HandOfGuldan cast.
          const timeDelta = (IMP_DURATION * MILLISECONDS) - (event.timestamp - hog) + (1.5 * MILLISECONDS);//Add an extra 1.5s to compensate for the delay between HoG cast and imp spawn.
          this.total_empowered_time += timeDelta;
        }
      }<commit_msg>Fix more style issues.<commit_after>import React from 'react';

import Analyzer from 'Parser/Core/Analyzer';

import SPELLS from 'common/SPELLS';
import SpellLink from 'common/SpellLink';

import {formatPercentage} from 'common/format';
import StatisticBox from 'Main/StatisticBox';
import SpellIcon from 'common/SpellIcon';

const IMP_DURATION = 12;
const MILLISECONDS = 1000;

class DemEmpUptimeHoG extends Analyzer{
  unempowered_casts = [];
  hog_casts = 0;
  total_empowered_time = 0;

  get uptime(){
    return this.total_empowered_time / (this.hog_casts * IMP_DURATION * MILLISECONDS);
  }

  get suggestionThresholds(){
    return {
      actual: this.uptime,
      isLessThan: {
        minor: 0.95,
        average: 0.9,
        major: 0.8,
      },
      style: 'percentage',
    };
  }

  on_byPlayer_cast(event){
    const spellId = event.ability.guid;
    if(spellId === SPELLS.HAND_OF_GULDAN_CAST.id){
      this.hog_casts += 1;
      this.unempowered_casts.push(event.timestamp);
    } else if (spellId === SPELLS.DEMONIC_EMPOWERMENT.id){
      this.unempowered_casts.forEach((e) => {
        if(event.timestamp - e <= IMP_DURATION * MILLISECONDS){
          const time_delta = (IMP_DURATION * MILLISECONDS) - (event.timestamp - e) + (1.5 * MILLISECONDS);//Add an extra 1.5s to compensate for the delay between HoG cast and imp spawn.
          this.total_empowered_time += time_delta;
        }
      });
{'fraction_non_alphanumeric': 0.11141396933560477, 'fraction_numerical': 0.013628620102214651, 'mean_word_length': 3.236652236652237, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '1564731', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1009, 'n_words': 229}