eyaltoledano/claude-task-master · error

${this.name} does not support score-based levels

Error message

${this.name} does not support score-based levels

What it means

getLevelFromScore() maps a numeric score (1-10) to a level, but only for indicator sets that define a thresholds table. If the indicator was constructed without thresholds (score-based levels unsupported — e.g. a simple status indicator), calling this method throws with the indicator's name in the message. This is an API-misuse guard, not a data error.

Source

Thrown at src/ui/indicators.js:32

/**
 * Base configuration for indicator systems
 */
class IndicatorConfig {
	constructor(name, levels, colors, thresholds = null) {
		this.name = name;
		this.levels = levels;
		this.colors = colors;
		this.thresholds = thresholds;
	}

	getColor(level) {
		return this.colors[level] || chalk.gray;
	}

	getLevelFromScore(score) {
		if (!this.thresholds) {
			throw new Error(`${this.name} does not support score-based levels`);
		}

		if (score >= 7) return this.levels[0]; // high
		if (score <= 3) return this.levels[2]; // low
		return this.levels[1]; // medium
	}
}

/**
 * Visual style definitions
 */
const VISUAL_STYLES = {
	cli: {
		filled: '●', // ●
		empty: '○' // ○
	},
	statusBar: {
		high: '⋮', // ⋮

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Use an indicator configured with thresholds (e.g. new Indicator({ name, thresholds: {...}, levels: [...] })).
  2. Call the correct accessor for non-score indicators (e.g. the level/status property or a status-based getter) instead of getLevelFromScore.
  3. Check this.thresholds on the indicator instance before calling, and branch to a fallback presentation.
  4. Rename or re-instantiate the indicator if a refactor changed its scoring capability.

Example fix

// before
const ind = new Indicator({ name: 'status' });
const lvl = ind.getLevelFromScore(8); // throws
// after
const ind = new Indicator({
  name: 'quality',
  thresholds: true,
  levels: ['high', 'medium', 'low']
});
const lvl = ind.getLevelFromScore(8); // 'high'
Defensive patterns

Strategy: type-guard

Validate before calling

function canUseScoreLevels(indicator) {
  return indicator && indicator.thresholds != null;
}
if (canUseScoreLevels(indicator)) {
  level = indicator.getLevelFromScore(score);
} else {
  level = indicator.level; // status-based fallback
}

Type guard

const supportsScoreLevels = (ind) =>
  ind != null && ind.thresholds != null && typeof ind.getLevelFromScore === 'function';

Try / catch

try {
  level = indicator.getLevelFromScore(score);
} catch (err) {
  if (err.message.endsWith('does not support score-based levels')) {
    console.warn(`${err.message} — using default level`);
    level = indicator.levels?.[1] ?? 'medium';
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: Calling scoreIndicator.getLevelFromScore(8) on an indicator like a basic status indicator created without a thresholds option; a refactor switching an indicator from score-based to status-based while callers still call getLevelFromScore; passing the wrong indicator object to shared rendering code.

Common situations: Rendering code that assumes all indicators support scores; tests or utilities reusing a generic indicator for score display; configuration change removing thresholds from a previously score-based indicator.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/fe01648c5fc6f489. Report an issue: GitHub.