Class JavaMetrics
- java.lang.Object
-
- net.sourceforge.pmd.lang.java.metrics.JavaMetrics
-
public final class JavaMetrics extends java.lang.ObjectUser bound façade of the Metrics Framework. Provides a uniform interface for the calculation of metrics.- Author:
- Clément Fournier
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static doubleget(net.sourceforge.pmd.lang.metrics.MetricKey<ASTAnyTypeDeclaration> key, ASTAnyTypeDeclaration 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<ASTAnyTypeDeclaration> key, ASTAnyTypeDeclaration node, net.sourceforge.pmd.lang.metrics.MetricOptions options)Computes a metric identified by its code on a class AST node, possibly selecting a variant with theMetricOptionsparameter.static doubleget(net.sourceforge.pmd.lang.metrics.MetricKey<MethodLikeNode> key, ASTAnyTypeDeclaration 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<MethodLikeNode> key, ASTAnyTypeDeclaration 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<MethodLikeNode> key, ASTMethodOrConstructorDeclaration node)Deprecated.Provided here for backwards binary compatibility withget(MetricKey, MethodLikeNode).static doubleget(net.sourceforge.pmd.lang.metrics.MetricKey<MethodLikeNode> key, ASTMethodOrConstructorDeclaration node, net.sourceforge.pmd.lang.metrics.MetricOptions options)Deprecated.Provided here for backwards binary compatibility withget(MetricKey, MethodLikeNode, MetricOptions).static doubleget(net.sourceforge.pmd.lang.metrics.MetricKey<MethodLikeNode> key, MethodLikeNode 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<MethodLikeNode> key, MethodLikeNode node, net.sourceforge.pmd.lang.metrics.MetricOptions options)Computes a metric identified by its key on a operation AST node.
-
-
-
Method Detail
-
get
public static double get(net.sourceforge.pmd.lang.metrics.MetricKey<ASTAnyTypeDeclaration> key, ASTAnyTypeDeclaration 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<ASTAnyTypeDeclaration> key, ASTAnyTypeDeclaration node, net.sourceforge.pmd.lang.metrics.MetricOptions options)
Computes a metric identified by its code on a class AST node, possibly selecting a variant with theMetricOptionsparameter.- 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<MethodLikeNode> key, MethodLikeNode 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<MethodLikeNode> key, ASTMethodOrConstructorDeclaration node)
Deprecated.Provided here for backwards binary compatibility withget(MetricKey, MethodLikeNode). Please explicitly link your code to that method and recompile your code. Will be remove with 7.0.0- See Also:
get(MetricKey, MethodLikeNode)
-
get
@Deprecated public static double get(net.sourceforge.pmd.lang.metrics.MetricKey<MethodLikeNode> key, ASTMethodOrConstructorDeclaration node, net.sourceforge.pmd.lang.metrics.MetricOptions options)
Deprecated.Provided here for backwards binary compatibility withget(MetricKey, MethodLikeNode, MetricOptions). Please explicitly link your code to that method and recompile your code. Will be remove with 7.0.0
-
get
public static double get(net.sourceforge.pmd.lang.metrics.MetricKey<MethodLikeNode> key, MethodLikeNode node, net.sourceforge.pmd.lang.metrics.MetricOptions options)
Computes a metric identified by its key on a operation AST node.- 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<MethodLikeNode> key, ASTAnyTypeDeclaration 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
-
get
public static double get(net.sourceforge.pmd.lang.metrics.MetricKey<MethodLikeNode> key, ASTAnyTypeDeclaration 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 metricresultOption- The result option to useoptions- The version of the metric- Returns:
- The value of the metric, or
Double.NaNif the value couldn't be computed
-
-