Skip to content

Commit

Permalink
[Chore] Remove unused exports detected by Knip
Browse files Browse the repository at this point in the history
  • Loading branch information
Pewtro committed Apr 22, 2024
1 parent b67a4cb commit 6fa173e
Show file tree
Hide file tree
Showing 171 changed files with 324 additions and 2,320 deletions.
1 change: 1 addition & 0 deletions src/CHANGELOG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import SpellLink from 'interface/SpellLink';

// prettier-ignore
export default [
change(date(2024, 4, 23), 'Second pass at cleaning up dead code using knip', Putro),
change(date(2024, 4, 22), 'Clean up dead code using knip', Putro),
change(date(2024, 4, 20), 'Fix friendly/enemy determination', emallson),
change(date(2024, 4, 17), 'Add 10.2.7 patch.', ToppleTheNun),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Gauge from 'parser/ui/Gauge';
import Statistic from 'parser/ui/Statistic';
import STATISTIC_ORDER from 'parser/ui/STATISTIC_ORDER';

export const instantCastSpells = [SPELLS.STARFALL, SPELLS.MOONFIRE, SPELLS.INSECT_SWARM];
const instantCastSpells = [SPELLS.STARFALL, SPELLS.MOONFIRE, SPELLS.INSECT_SWARM];

export const displayInstantCastSpells = () =>
instantCastSpells.map((s, i) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
GetRelatedEvents,
HasRelatedEvent,
HealEvent,
RefreshBuffEvent,
RemoveBuffEvent,
ResourceChangeEvent,
} from 'parser/core/Events';
Expand All @@ -17,14 +16,14 @@ import { Options } from 'parser/core/Module';
const CAST_BUFFER_MS = 65;
const TRANQ_CHANNEL_BUFFER_MS = 10_000;

export const APPLIED_HEAL = 'AppliedHeal';
export const FROM_HARDCAST = 'FromHardcast';
export const FROM_EXPIRING_LIFEBLOOM = 'FromExpiringLifebloom';
export const CAUSED_BLOOM = 'CausedBloom';
export const CAUSED_TICK = 'CausedTick';
export const REGEN_FROM_LIFEBLOOM = 'RegenFromLifebloom';
export const CAUSED_REGEN = 'CausedRegen';
export const FROM_CLEARCAST = 'FromClearcast';
const APPLIED_HEAL = 'AppliedHeal';
const FROM_HARDCAST = 'FromHardcast';
const FROM_EXPIRING_LIFEBLOOM = 'FromExpiringLifebloom';
const CAUSED_BLOOM = 'CausedBloom';
const CAUSED_TICK = 'CausedTick';
const REGEN_FROM_LIFEBLOOM = 'RegenFromLifebloom';
const CAUSED_REGEN = 'CausedRegen';
const FROM_CLEARCAST = 'FromClearcast';

const EVENT_LINKS: EventLink[] = [
{
Expand Down Expand Up @@ -149,15 +148,6 @@ export function isFromHardcast(event: AbilityEvent<any>): boolean {
return HasRelatedEvent(event, FROM_HARDCAST);
}

/** Returns the hardcast event that caused this buff or heal, if there is one */
export function getHardcast(event: AbilityEvent<any>): CastEvent | undefined {
return GetRelatedEvents<CastEvent>(
event,
FROM_HARDCAST,
(e): e is CastEvent => e.type === EventType.Cast,
).pop();
}

/** Returns the buff application and direct heal events caused by the given hardcast */
export function getHeals(event: CastEvent): AnyEvent[] {
return GetRelatedEvents(event, APPLIED_HEAL);
Expand All @@ -170,23 +160,6 @@ export function getDirectHeal(event: CastEvent): HealEvent | undefined {
.pop();
}

/** Returns true iff the given bloom heal can be linked to the refresh or removal of a lifebloom
* buff - used to differentiate from a Photosynthesis proc */
export function isFromExpiringLifebloom(event: HealEvent): boolean {
return HasRelatedEvent(event, FROM_EXPIRING_LIFEBLOOM);
}

/** Returns true iff the bloom expiration caused a bloom to proc */
export function causedBloom(event: RemoveBuffEvent | RefreshBuffEvent): boolean {
return HasRelatedEvent(event, CAUSED_BLOOM);
}

/** Gets the tranquility "tick cast" events caused by channeling the given Tranquility w/
* cast ID `TRANQUILITY_CAST`. */
export function getTranquilityTicks(event: CastEvent): AnyEvent[] {
return GetRelatedEvents(event, CAUSED_TICK);
}

export function getBloomCausingRegen(event: ResourceChangeEvent): RemoveBuffEvent | undefined {
return GetRelatedEvents<RemoveBuffEvent>(
event,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Options } from 'parser/core/Module';

const REMOVE_BUFFER_MS = 50;

export const CONSUMED_HOT = 'ConsumedHot';
const CONSUMED_HOT = 'ConsumedHot';

const EVENT_LINKS: EventLink[] = [
{
Expand Down
4 changes: 1 addition & 3 deletions src/analysis/classic/shaman/shared/totems/totemConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,13 @@ export const TOTEMS_BY_ELEMENT = {
],
};

export const All_TOTEMS = [
const All_TOTEMS = [
...TOTEMS_BY_ELEMENT[TotemElements.Fire],
...TOTEMS_BY_ELEMENT[TotemElements.Water],
...TOTEMS_BY_ELEMENT[TotemElements.Earth],
...TOTEMS_BY_ELEMENT[TotemElements.Air],
];

export const TotemFilter = (element: TotemElements) =>
TOTEMS_BY_ELEMENT[element].map((totemId) => ({ id: totemId }));
export const AllTotemsFilter = () => All_TOTEMS.map((totemId) => ({ id: totemId }));

export const TotemDurations = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Options } from 'parser/core/Analyzer';
import EventLinkNormalizer, { EventLink } from 'parser/core/EventLinkNormalizer';
import { AbsorbedEvent, DamageEvent, EventType } from 'parser/core/Events';

export const BLOOD_SHIELD_ABSORB = 'blood-shield-absorb';
const BLOOD_SHIELD_ABSORB = 'blood-shield-absorb';
export const BLOOD_SHIELD_ABSORBED_HIT = 'blood-shield-absorbed-hit';

const absorbLink: EventLink = {
Expand Down
18 changes: 0 additions & 18 deletions src/analysis/retail/demonhunter/havoc/constants.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
export const CRITICAL_CHAOS_SCALING = [0, 0.25, 0.5];

export const FELFIRE_HEART_SCALING = [0, 1, 2];

export const UNBOUND_CHAOS_SCALING = [0, 2, 4];

export const BLIND_FURY_FURY_SCALING = [0, 20, 40];

export const BLIND_FURY_DURATION_SCALING = [0, 0.25, 0.5];

export const SERRATED_GLAIVE_SCALING = [0, 0.1, 0.2];

export const RELENTLESS_ONSLAUGHT_SCALING = [0, 0.06, 0.12];

export const KNOW_YOUR_ENEMY_SCALING = [0, 0.5, 1.0];

export const CYCLE_OF_HATRED_SCALING = [0, 0.5, 1];

export const SOULREND_SCALING = [0, 0.6, 1.2];

export const GROWING_INFERNO_SCALING = [0, 0.08, 0.15];

export const BURNING_WOUND_SCALING = [0, 0.4];

export const MOMENTUM_SCALING = [0, 0.08];
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { formatPercentage } from 'common/format';
import Tooltip from 'interface/Tooltip';
import InformationIcon from 'interface/icons/Information';

export const SCALING_PER_TARGET_HIT = 0.3;
export const INITIAL_HIT_SCALING = 0.6;
const SCALING_PER_TARGET_HIT = 0.3;
const INITIAL_HIT_SCALING = 0.6;

export const AcceleratingBladeExplanation = () => {
const info = useInfo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,3 @@ export function getPreviousVengefulRetreat(event: CastEvent): CastEvent | undefi
(e): e is CastEvent => e.type === EventType.Cast,
).find(Boolean);
}

export function getPreviousEyeBeam(event: CastEvent): CastEvent | undefined {
return GetRelatedEvents<CastEvent>(
event,
ESSENCE_BREAK_AFTER_EYE_BEAM,
(e): e is CastEvent => e.type === EventType.Cast,
).find(Boolean);
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import SPELLS from 'common/SPELLS/demonhunter';
import {
ApplyBuffEvent,
CastEvent,
EventType,
GetRelatedEvent,
RefreshBuffEvent,
RemoveBuffEvent,
} from 'parser/core/Events';
import { CastEvent, EventType, GetRelatedEvent, RemoveBuffEvent } from 'parser/core/Events';
import { Options } from 'parser/core/Module';
import EventLinkNormalizer, { EventLink } from 'parser/core/EventLinkNormalizer';
import TALENTS from 'common/TALENTS/demonhunter';
Expand Down Expand Up @@ -47,16 +40,6 @@ export default class UnboundChaosNormalizer extends EventLinkNormalizer {
}
}

export function getUnboundChaosApplication(
event: ApplyBuffEvent | RefreshBuffEvent,
): CastEvent | undefined {
return GetRelatedEvent(
event,
UNBOUND_CHAOS_APPLICATION,
(e): e is CastEvent => e.type === EventType.Cast,
);
}

export function getUnboundChaosConsumption(event: RemoveBuffEvent): CastEvent | undefined {
return GetRelatedEvent(
event,
Expand Down
7 changes: 2 additions & 5 deletions src/analysis/retail/demonhunter/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ export { default as SwallowedAnger } from './modules/talents/SwallowedAnger';
export { default as FlamesOfFury } from './modules/talents/FlamesOfFury';
export { default as DisruptingFury } from './modules/talents/DisruptingFury';
export { default as DemonSoulBuff } from './modules/spells/DemonSoulBuff';
export { default as TheHuntNormalizer, getChargeImpact } from './normalizers/TheHuntNormalizer';
export {
default as SigilOfFlameNormalizer,
getSigilOfFlameDamages,
} from './normalizers/SigilOfFlameNormalizer';
export { default as TheHuntNormalizer } from './normalizers/TheHuntNormalizer';
export { default as SigilOfFlameNormalizer } from './normalizers/SigilOfFlameNormalizer';
export { default as SigilOfFlame } from './modules/spells/SigilOfFlame';
export * from './constants';
22 changes: 0 additions & 22 deletions src/analysis/retail/demonhunter/vengeance/constants.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
export const EXTENDED_SPIKES_SCALING = [0, 2];

export const CHAINS_OF_ANGER_SCALING = [0, 2];

export const AGONIZING_FLAMES_SPEED_SCALING = [0, 0.2];

export const AGONIZING_FLAMES_DURATION_SCALING = [0, 0.5];

export const PAINBRINGER_SCALING = [0, 0.01, 0.02];

export const DARKGLARE_BOON_CDR_SCALING = [0, 40];

export const DARKGLARE_BOON_FURY_REFUND_SCALING = [0, 40];

export const CYCLE_OF_BINDING_SCALING = [0, 3];

export const VULNERABILITY_SCALING = [0, 0.02, 0.04];

export const FEED_THE_DEMON_SCALING = [0, 0.25, 0.5];

export const CHARRED_FLESH_SCALING = [0, 0.25, 0.5];

export const FIERY_DEMISE_SCALING = [0, 0.25, 0.5];

export const PERFECTLY_BALANCED_GLAIVE_SCALING = [0, 6];

export const METEORIC_STRIKES_SCALING = [0, 10];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Options } from 'parser/core/Analyzer';
import EventLinkNormalizer, { EventLink } from 'parser/core/EventLinkNormalizer';
import { ApplyBuffEvent, EventType, GetRelatedEvent, RemoveBuffEvent } from 'parser/core/Events';
import { EventType } from 'parser/core/Events';
import { buffId, MAJOR_DEFENSIVES } from './DefensiveBuffs';
import { isTalent } from 'common/TALENTS/types';

Expand All @@ -27,11 +27,3 @@ export default class DefensiveBuffLinkNormalizer extends EventLinkNormalizer {
super(options, links);
}
}

export function defensiveApplication(event: RemoveBuffEvent): ApplyBuffEvent | undefined {
return GetRelatedEvent(event, reverseRelation);
}

export function defensiveExpiration(event: ApplyBuffEvent): RemoveBuffEvent | undefined {
return GetRelatedEvent(event, relation);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import SPELLS from 'common/SPELLS/demonhunter';
import {
CastEvent,
DamageEvent,
EventType,
GetRelatedEvents,
RemoveBuffStackEvent,
} from 'parser/core/Events';
import { CastEvent, DamageEvent, EventType, GetRelatedEvents } from 'parser/core/Events';
import { Options } from 'parser/core/Module';
import EventLinkNormalizer, { EventLink } from 'parser/core/EventLinkNormalizer';

Expand Down Expand Up @@ -47,14 +41,6 @@ export default class SoulCleaveEventLinkNormalizer extends EventLinkNormalizer {
}
}

export function getSoulCleaveSoulConsumptions(event: CastEvent): RemoveBuffStackEvent[] {
return GetRelatedEvents(
event,
SOUL_CLEAVE_SOUL_CONSUME,
(e): e is RemoveBuffStackEvent => e.type === EventType.RemoveBuffStack,
);
}

export function getSoulCleaveDamages(event: CastEvent): DamageEvent[] {
return GetRelatedEvents(
event,
Expand Down
6 changes: 2 additions & 4 deletions src/analysis/retail/druid/balance/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export function cdSpell(c: Combatant): Spell {
: SPELLS.CELESTIAL_ALIGNMENT;
}

export const CA_DURATION = 20_000;
export const INCARN_DURATION = 30_000;
const CA_DURATION = 20_000;
const INCARN_DURATION = 30_000;
/** Returns the duration of Balance Druid's primary cooldown spell, which changes based on talent */
export function cdDuration(c: Combatant): number {
return c.hasTalent(TALENTS_DRUID.INCARNATION_CHOSEN_OF_ELUNE_TALENT)
Expand All @@ -57,8 +57,6 @@ export function currentEclipse(c: Combatant): 'none' | 'solar' | 'lunar' | 'both
}

export const GUIDE_CORE_EXPLANATION_PERCENT = 40;
export const STARSURGE_ELUNES_GUIDANCE_DISCOUNT = 8;
export const STARFALL_ELUNES_GUIDANCE_DISCOUNT = 10;
export const STARSURGE_BASE_COST = 40;
export const STARFALL_BASE_COST = 50;
export const ASTRAL_POWER_SCALE_FACTOR = 0.1; // in events all values are x10
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SPELLS from 'common/SPELLS';
import UptimeIcon from 'interface/icons/Uptime';
import { WHITELIST_ABILITIES } from '../../constants';

export const FOTF_DAMAGE_INCREASE = 0.1;
const FOTF_DAMAGE_INCREASE = 0.1;

class FriendOfTheFae extends Analyzer {
totalAddedDamage = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
import SPELLS from 'common/SPELLS';
import EventLinkNormalizer, { EventLink } from 'parser/core/EventLinkNormalizer';
import {
CastEvent,
DamageEvent,
EventType,
GetRelatedEvents,
HasRelatedEvent,
} from 'parser/core/Events';
import { CastEvent, EventType, GetRelatedEvents } from 'parser/core/Events';
import { Options } from 'parser/core/Module';

const CAST_BUFFER_MS = 100;

export const FROM_HARDCAST = 'FromHardcast';
export const HITS_TARGET = 'HitsTarget';
const FROM_HARDCAST = 'FromHardcast';
const HITS_TARGET = 'HitsTarget';

const EVENT_LINKS: EventLink[] = [
{
Expand All @@ -39,10 +33,6 @@ class CastLinkNormalizer extends EventLinkNormalizer {
}
}

export function isFromHardcast(event: DamageEvent): boolean {
return HasRelatedEvent(event, FROM_HARDCAST);
}

export function hardcastTargetsHit(event: CastEvent): number {
return GetRelatedEvents(event, HITS_TARGET).length;
}
Expand Down
Loading

0 comments on commit 6fa173e

Please sign in to comment.