<commit_before>import React from 'react';

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

import Analyzer from 'Parser/Core/Analyzer';
import Combatants from 'Parser/Core/Modules/Combatants';
import SpellUsable from 'Parser/Core/Modules/SpellUsable';

import AbilityTracker from './PaladinAbilityTracker';

/** @type {number} (ms) When Holy Shock has less than this as cooldown remaining you should wait and still not cast that filler FoL. */
const HOLY_SHOCK_COOLDOWN_WAIT_TIME = 200;

/**
 * First there was a check that you shouldn't cast a filler FoL when HS is ready because it is inefficient because HS is that much more efficient a spell (see the statistics in the Holy Paladin spreadsheet). I figured that waiting a fraction of a second for HS to become available would have the same result.
 *
 * The question is how much of a fraction of a second? I am fairly confident feelycrafting that waiting 200ms is more efficient, and I think up to 300ms is also going to be more efficient, maybe a bit further but hard to say.
 *
 * So then the question is what is a reasonable amount to ask of a player? I think 200ms is an amount that is very hard to differentiate from a spell just coming off cooldown. It's a delay similar to latency during raid fights. Spamming HS while its icon is as good as off cooldown would be the best course of action here and not take any uber skills form the player. So I reckon it's reasonable to include casts as being inefficient casts at this interval.
 */
class FillerFlashOfLight extends Analyzer {
  static dependencies = {
    combatants: Combatants,
    abilityTracker: AbilityTracker,
    spellUsable: SpellUsable,
  };

  inefficientCasts = [];
  _isCurrentCastInefficient = false;
  on_byPlayer_begincast(event) {
    const spellId = event.ability.guid;
    if (spellId !== SPELLS.FLASH_OF_LIGHT.id) {
      return;
    }
    if (this._isInefficientCastEvent(event)) {
      this.inefficientCasts.push(event);
      this._isCurrentCastInefficient = true;
    } else {
      this._isCurrentCastInefficient = false;
    }<commit_msg>Add a comment to an example log<commit_after>import React from 'react';

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

import Analyzer from 'Parser/Core/Analyzer';
import Combatants from 'Parser/Core/Modules/Combatants';
import SpellUsable from 'Parser/Core/Modules/SpellUsable';

import AbilityTracker from './PaladinAbilityTracker';

/** @type {number} (ms) When Holy Shock has less than this as cooldown remaining you should wait and still not cast that filler FoL. */
const HOLY_SHOCK_COOLDOWN_WAIT_TIME = 200;

/**
 * First there was a check that you shouldn't cast a filler FoL when HS is ready because it is inefficient because HS is that much more efficient a spell (see the statistics in the Holy Paladin spreadsheet). I figured that waiting a fraction of a second for HS to become available would have the same result.
 *
 * The question is how much of a fraction of a second? I am fairly confident feelycrafting that waiting 200ms is more efficient, and I think up to 300ms is also going to be more efficient, maybe a bit further but hard to say.
 *
 * So then the question is what is a reasonable amount to ask of a player? I think 200ms is an amount that is very hard to differentiate from a spell just coming off cooldown. It's a delay similar to latency during raid fights. Spamming HS while its icon is as good as off cooldown would be the best course of action here and not take any uber skills form the player. So I reckon it's reasonable to include casts as being inefficient casts at this interval.
 *
 * Example log with 16 inefficient casts: report/kzKnrR4qdhXGjB38/16-Heroic+Aggramar+-+Kill+(6:50)/13-Seedÿ
 */
class FillerFlashOfLight extends Analyzer {
  static dependencies = {
    combatants: Combatants,
    abilityTracker: AbilityTracker,
    spellUsable: SpellUsable,
  };

  inefficientCasts = [];
  _isCurrentCastInefficient = false;
  on_byPlayer_begincast(event) {
    const spellId = event.ability.guid;
    if (spellId !== SPELLS.FLASH_OF_LIGHT.id) {
      return;
    }
    if (this._isInefficientCastEvent(event)) {
      this.inefficientCasts.push(event);
      this._isCurrentCastInefficient = true;
    } else {
      this._isCurrentCastInefficient = false;
    }
{'fraction_non_alphanumeric': 0.06378647364849581, 'fraction_numerical': 0.0081429540827867, 'mean_word_length': 4.153846153846154, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '374776', 'n_tokens_mistral': 1317, 'n_tokens_neox': 1233, 'n_words': 561}