Interface LanguageMetricsProvider


  • public interface LanguageMetricsProvider
    Language-specific provider for metrics. Knows about all the metrics defined for a language. Can be used e.g. to build GUI applications like the designer, in a language independent way. Accessible through LanguageVersionHandler.getLanguageMetricsProvider().
    Author:
    Clément Fournier
    Since:
    6.11.0
    • Method Detail

      • getMetrics

        Set<Metric<?,​?>> getMetrics()
        Returns the set of all metrics supported by the language.
      • getMetricWithName

        default @Nullable Metric<?,​?> getMetricWithName​(String nameIgnoringCase)
        Fetch a metric using its name.
      • computeAllMetricsFor

        default Map<Metric<?,​?>,​Number> computeAllMetricsFor​(Node node)
        Computes all metrics available on the given node. The returned results may contain Double.NaN as a value.
        Parameters:
        node - Node to inspect
        Returns:
        A map of metric key to their result, possibly empty, but with no null value