Class ApexMetrics
- java.lang.Object
-
- net.sourceforge.pmd.lang.apex.metrics.ApexMetrics
-
public final class ApexMetrics extends java.lang.ObjectUser-bound façade of the Apex metrics framework.- Since:
- 6.0.0
- Author:
- Clément Fournier
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doubleget(net.sourceforge.pmd.lang.metrics.MetricKey<ASTMethod> key, ASTMethod node)Computes the standard version of the metric identified by the key on a operation AST node.static doubleget(net.sourceforge.pmd.lang.metrics.MetricKey<ASTMethod> key, ASTMethod node, net.sourceforge.pmd.lang.metrics.MetricOptions options)Computes a metric identified by its key on a operation AST node, possibly selecting metric options with theoptionsparameter.static doubleget(net.sourceforge.pmd.lang.metrics.MetricKey<ASTMethod> key, ASTUserClassOrInterface<?> node, net.sourceforge.pmd.lang.metrics.MetricOptions options, net.sourceforge.pmd.lang.metrics.ResultOption resultOption)Compute the sum, average, or highest value of the operation metric on all operations of the class node.static doubleget(net.sourceforge.pmd.lang.metrics.MetricKey<ASTMethod> key, ASTUserClassOrInterface<?> node, net.sourceforge.pmd.lang.metrics.ResultOption resultOption)Compute the sum, average, or highest value of the standard operation metric on all operations of the class node.static doubleget(net.sourceforge.pmd.lang.metrics.MetricKey<ASTUserClassOrInterface<?>> key, ASTUserClass node)Computes the standard value of the metric identified by its code on a class AST node.static doubleget(net.sourceforge.pmd.lang.metrics.MetricKey<ASTUserClassOrInterface<?>> key, ASTUserClass node, net.sourceforge.pmd.lang.metrics.MetricOptions options)Computes a metric identified by its code on a class AST node, possibly selecting metric options with theoptionsparameter.static ApexMetricsFacadegetFacade()Returns the underlying facade.
-
-
-
Method Detail
-
getFacade
public static ApexMetricsFacade getFacade()
Returns the underlying facade.- Returns:
- The facade
-
get
public static double get(net.sourceforge.pmd.lang.metrics.MetricKey<ASTUserClassOrInterface<?>> key, ASTUserClass node)
Computes the standard value of the metric identified by its code on a class AST node.- Parameters:
key- The key identifying the metric to be computednode- The node on which to compute the metric- Returns:
- The value of the metric, or
Double.NaNif the value couldn't be computed
-
get
public static double get(net.sourceforge.pmd.lang.metrics.MetricKey<ASTUserClassOrInterface<?>> key, ASTUserClass node, net.sourceforge.pmd.lang.metrics.MetricOptions options)
Computes a metric identified by its code on a class AST node, possibly selecting metric options with theoptionsparameter.- Parameters:
key- The key identifying the metric to be computednode- The node on which to compute the metricoptions- The options of the metric- Returns:
- The value of the metric, or
Double.NaNif the value couldn't be computed
-
get
public static double get(net.sourceforge.pmd.lang.metrics.MetricKey<ASTMethod> key, ASTMethod node)
Computes the standard version of the metric identified by the key on a operation AST node.- Parameters:
key- The key identifying the metric to be computednode- The node on which to compute the metric- Returns:
- The value of the metric, or
Double.NaNif the value couldn't be computed
-
get
public static double get(net.sourceforge.pmd.lang.metrics.MetricKey<ASTMethod> key, ASTMethod node, net.sourceforge.pmd.lang.metrics.MetricOptions options)
Computes a metric identified by its key on a operation AST node, possibly selecting metric options with theoptionsparameter.- Parameters:
key- The key identifying the metric to be computednode- The node on which to compute the metricoptions- The options of the metric- Returns:
- The value of the metric, or
Double.NaNif the value couldn't be computed
-
get
public static double get(net.sourceforge.pmd.lang.metrics.MetricKey<ASTMethod> key, ASTUserClassOrInterface<?> node, net.sourceforge.pmd.lang.metrics.ResultOption resultOption)
Compute the sum, average, or highest value of the standard operation metric on all operations of the class node. The type of operation is specified by theResultOptionparameter.- Parameters:
key- The key identifying the metric to be computednode- The node on which to compute the metricresultOption- The result option to use- Returns:
- The value of the metric, or
Double.NaNif the value couldn't be computed oroptionisnull
-
get
public static double get(net.sourceforge.pmd.lang.metrics.MetricKey<ASTMethod> key, ASTUserClassOrInterface<?> node, net.sourceforge.pmd.lang.metrics.MetricOptions options, net.sourceforge.pmd.lang.metrics.ResultOption resultOption)
Compute the sum, average, or highest value of the operation metric on all operations of the class node. The type of operation is specified by theResultOptionparameter.- Parameters:
key- The key identifying the metric to be computednode- The node on which to compute the metricoptions- The options of the metricresultOption- The result option to use- Returns:
- The value of the metric, or
Double.NaNif the value couldn't be computed oroptionisnull
-
-