Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[devtools] Improve Content Complexity Scoring Plugin Capabilities #176

Open
kharrop opened this issue Nov 7, 2024 · 0 comments
Open

[devtools] Improve Content Complexity Scoring Plugin Capabilities #176

kharrop opened this issue Nov 7, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@kharrop
Copy link
Contributor

kharrop commented Nov 7, 2024

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:

  • Support a scalable way to output better summaries/totals
  • Reduce redundancies where the filepath appends to each diagnostic; perhaps color code the file or move the file up and only show the line?

Update the complexity plugin to:

  • Account for more weighted complexity than just types (based on this comment); would be something like { type: "foo", metaData: { role: "bar" } }

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,
          });
        }
      });
@kharrop kharrop added the enhancement New feature or request label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant