<commit_before>import React from 'react';
import Analyzer from 'parser/core/Analyzer';
import {formatPercentage, formatNumber} from 'common/format';
import { calculateAzeriteEffects } from 'common/stats';
import SPELLS from 'common/SPELLS/index';
import TraitStatisticBox, { STATISTIC_ORDER } from 'interface/others/TraitStatisticBox';
import StatWeights from '../../../../../druid/restoration/modules/features/StatWeights';

/**
 Casting Wild Growth grants you 165 Mastery for 10 sec sec. This cannot occur more than once every 30 sec.
 Example Log: /report/nfVcdAMXFGBgwvzp/2-Heroic+Taloc+-+Kill+(3:55)/21-Palamx
 */
class SynergisticGrowth extends Analyzer{
  static dependencies = {
    statWeights: StatWeights,
  };

  masteryBuff = 0;

  constructor(...args){
    super(...args);
    this.active = this.selectedCombatant.hasTrait(SPELLS.SYNERGISTIC_GROWTH.id);
    if(this.active) {
      this.masteryBuff = this.selectedCombatant.traitsBySpellId[SPELLS.SYNERGISTIC_GROWTH.id]
        .reduce((sum, rank) => sum + calculateAzeriteEffects(SPELLS.SYNERGISTIC_GROWTH.id, rank)[0], 0);
    }
  }

  get totalBuffUptime() {
    return this.selectedCombatant.getBuffUptime(SPELLS.SYNERGISTIC_GROWTH_BUFF.id) / this.owner.fightDuration;
  }

  get averageStatGain(){
    const averageStacks = this.selectedCombatant.getStackWeightedBuffUptime(SPELLS.SYNERGISTIC_GROWTH_BUFF.id) / this.owner.fightDuration;
    return averageStacks * this.masteryBuff;
  }

  statistic(){
    return(
      <TraitStatisticBox
        position={STATISTIC_ORDER.OPTIONAL()}
        trait={SPELLS.SYNERGISTIC_GROWTH.id}
        value={(
          <>
            {formatPercentage(this.totalBuffUptime)}% uptime<br />
            {formatNumber(this.averageStatGain)} average mastery gained.
          </>
        )}
      />
    );
  }
}

export default SynergisticGrowth;<commit_msg>cleaning up trait<commit_after>import React from 'react';
import Analyzer from 'parser/core/Analyzer';
import {formatPercentage, formatNumber} from 'common/format';
import { calculateAzeriteEffects } from 'common/stats';
import SPELLS from 'common/SPELLS/index';
import TraitStatisticBox, { STATISTIC_ORDER } from 'interface/others/TraitStatisticBox';

/**
 Casting Wild Growth grants you 165 Mastery for 10 sec sec. This cannot occur more than once every 30 sec.
 Example Log: /report/nfVcdAMXFGBgwvzp/2-Heroic+Taloc+-+Kill+(3:55)/21-Palamx
 */
class SynergisticGrowth extends Analyzer{
  masteryBuff = 0;
  procs = 0;

  constructor(...args){
    super(...args);
    this.active = this.selectedCombatant.hasTrait(SPELLS.SYNERGISTIC_GROWTH.id);
    if(this.active) {
      this.masteryBuff = this.selectedCombatant.traitsBySpellId[SPELLS.SYNERGISTIC_GROWTH.id]
        .reduce((sum, rank) => sum + calculateAzeriteEffects(SPELLS.SYNERGISTIC_GROWTH.id, rank)[0], 0);
    }
  }

  get totalBuffUptime() {
    return this.selectedCombatant.getBuffUptime(SPELLS.SYNERGISTIC_GROWTH_BUFF.id) / this.owner.fightDuration;
  }

  get totalBuffProcs() {
    return this.selectedCombatant.getBuffTriggerCount(SPELLS.SYNERGISTIC_GROWTH_BUFF.id);
  }

  get averageStatGain(){
    const averageStacks = this.selectedCombatant.getStackWeightedBuffUptime(SPELLS.SYNERGISTIC_GROWTH_BUFF.id) / this.owner.fightDuration;
    return averageStacks * this.masteryBuff;
  }

  statistic(){
    return(
      <TraitStatisticBox
        position={STATISTIC_ORDER.OPTIONAL()}
        trait={SPELLS.SYNERGISTIC_GROWTH.id}
        value={`${formatNumber(this.averageStatGain)} average Mastery`}
        tooltip={`
          ${formatPercentage(this.totalBuffUptime)}% Uptime<br />
          ${this.totalBuffProcs} Total Procs
        `}
      />
    );
  }
}

export default SynergisticGrowth;
{'fraction_non_alphanumeric': 0.11695278969957082, 'fraction_numerical': 0.008851931330472103, 'mean_word_length': 3.939072847682119, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '3836784', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1283, 'n_words': 213}