player-ui / tools

A Place for tooling related to Player
MIT License
9 stars 12 forks source link

[devtools] Improve Content Complexity Scoring Plugin Capabilities #176

Open kharrop opened 3 weeks ago

kharrop commented 3 weeks ago

The original feature will be added in this PR.

Is your feature request related to a problem? Please describe.

This ticket contains a list of enhancements that would improve the complexity tracking capabilities and documentation.

Describe the solution you'd like

Update diag-renderer.ts to:

Update the complexity plugin to:

Additional context

Some initial work on displaying the summary at the end of type count totals

  // TO DO: Potentially display this in a totals summary within diag-renderer
      if (
        this.config.typeWeights &&
        Object.keys(this.config.typeWeights).length > 0
      ) {
        this.verboseDetails.push({
          message: `----- Type Totals -----`,
          severity: DiagnosticSeverity.Information,
          range: diagnosticRange,
        });
      }

      Object.entries(this.typeCount).forEach(([type, count]) => {
        if (this.config.typeWeights) {
          const typeMultiplier = this.config.typeWeights[type];
          this.verboseDetails.push({
            message: `${type}: ${count} x ${typeMultiplier} pt = ${
              count * typeMultiplier
            }`,
            severity: DiagnosticSeverity.Information,
            range: diagnosticRange,
          });
        }
      });