<commit_before>import add from '../support/task';
import {colouredDots} from '../support/layout';
import {getValue} from '../support/system';
import {lastActivityRE} from '../support/dataObj';
import {
  calculateBoundaries,
  gvgLowerLevel,
  gvgUpperLevel,
  pvpLowerLevel,
  pvpUpperLevel
} from '../common/levelHighlight';
import {guildXPLock, removeGuildAvyImgBorder} from './guildUtils';

var highlightPlayersNearMyLvl;
var highlightGvGPlayersNearMyLvl;

function highlightMembers(el) {
  var tipped = el.dataset.tipped;
  var lastActDays = lastActivityRE.exec(tipped)[1];
  var vlevel = Number(/VL:.+?(\d+)/.exec(tipped)[1]);
  var aRow = el.parentNode.parentNode;
  if (lastActDays < 7 &&
      highlightPlayersNearMyLvl &&
      vlevel >= pvpLowerLevel &&
      vlevel <= pvpUpperLevel) {
    aRow.classList.add('lvlHighlight');
  } else if (lastActDays < 7 &&
      highlightGvGPlayersNearMyLvl &&
      vlevel >= gvgLowerLevel &&
      vlevel <= gvgUpperLevel) {
    aRow.classList.add('lvlGvGHighlight');
  }
}

export default function injectViewGuild() {
  add(3, colouredDots);
  removeGuildAvyImgBorder();
  guildXPLock();
  highlightPlayersNearMyLvl = getValue('highlightPlayersNearMyLvl');
  highlightGvGPlayersNearMyLvl = getValue('highlightGvGPlayersNearMyLvl');<commit_msg>reduce complexity (updated eslint rule 4.14.0)<commit_after>import add from '../support/task';
import {colouredDots} from '../support/layout';
import {getValue} from '../support/system';
import {lastActivityRE} from '../support/dataObj';
import {
  calculateBoundaries,
  gvgLowerLevel,
  gvgUpperLevel,
  pvpLowerLevel,
  pvpUpperLevel
} from '../common/levelHighlight';
import {guildXPLock, removeGuildAvyImgBorder} from './guildUtils';

var highlightPlayersNearMyLvl;
var highlightGvGPlayersNearMyLvl;

function isPvpTarget(vlevel) {
  return highlightPlayersNearMyLvl &&
    vlevel >= pvpLowerLevel &&
    vlevel <= pvpUpperLevel;
}

function isGvgTarget(vlevel) {
  return highlightGvGPlayersNearMyLvl &&
    vlevel >= gvgLowerLevel &&
    vlevel <= gvgUpperLevel;
}

function isActive(el, tipped) {
  var vlevel = Number(/VL:.+?(\d+)/.exec(tipped)[1]);
  var aRow = el.parentNode.parentNode;
  if (isPvpTarget(vlevel)) {
    aRow.classList.add('lvlHighlight');
  } else if (isGvgTarget(vlevel)) {
    aRow.classList.add('lvlGvGHighlight');
  }
}

function highlightMembers(el) {
  var tipped = el.dataset.tipped;
  var lastActDays = lastActivityRE.exec(tipped)[1];
  if (lastActDays < 7) {isActive(el, tipped);}
}

export default function injectViewGuild() {
  add(3, colouredDots);
  removeGuildAvyImgBorder();
  guildXPLock();
  highlightPlayersNearMyLvl = getValue('highlightPlayersNearMyLvl');
  highlightGvGPlayersNearMyLvl = getValue('highlightGvGPlayersNearMyLvl');
{'fraction_non_alphanumeric': 0.12991699747383617, 'fraction_numerical': 0.004691447130999639, 'mean_word_length': 5.105726872246696, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 7, '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': '3382196', 'n_tokens_mistral': 993, 'n_tokens_neox': 931, 'n_words': 172}