summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@ericsson.com>2018-09-22 21:07:43 +0100
committerliamfallon <liam.fallon@ericsson.com>2018-09-22 21:15:22 +0100
commit6973ec9109fd2651e2284663b6c8039bd830a677 (patch)
treef1f02ef9e5400805e6c2179dc539ad15c3ce5334 /examples
parenta02548ec2e98a8a13cd76ecc83379b13cd26030b (diff)
Fix sonar problems in Apex
Fixed some easy to resolve Sonar issues. Issue-ID: POLICY-1034 Change-Id: Ia8e4606bd4307daca499b4a74c96135211e572fd Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/concepts/AnomalyDetection.java6
-rw-r--r--examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java14
2 files changed, 10 insertions, 10 deletions
diff --git a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/concepts/AnomalyDetection.java b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/concepts/AnomalyDetection.java
index c70c9feb6..9dbfe266f 100644
--- a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/concepts/AnomalyDetection.java
+++ b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/concepts/AnomalyDetection.java
@@ -38,6 +38,9 @@ public class AnomalyDetection implements Serializable {
private boolean firstRound = true;
private int frequency = 0;
+ private List<Double> anomalyScores = new LinkedList<>();
+ private List<Double> frequencyForecasted;
+
/**
* The Constructor creates an AnomalyDetection instance.
*/
@@ -46,9 +49,6 @@ public class AnomalyDetection implements Serializable {
frequency = 0;
}
- private List<Double> anomalyScores = new LinkedList<>();
- private List<Double> frequencyForecasted;
-
/**
* Checks if the AnomalyDetection instance is initialized.
*
diff --git a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java
index 5ee114e0e..ffbaf5905 100644
--- a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java
+++ b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java
@@ -47,6 +47,13 @@ public class AnomalyDetectionPolicyDecideTaskSelectionLogic {
private static final double ANOMALY_SENSITIVITY = 0.05;
private static final int FREQUENCY = 360;
+ /*
+ * Some utility methods
+ */
+ // exponential = 2(n+1)
+ private static final double EMA_EXPONENT = 2.0 / (7.0 + 1.0);
+ private static final double EMA_EXPONENT_1 = (1.0 - EMA_EXPONENT);
+
/**
* A map to hold the Anomaly degree/levels/probabilities required for each task.<br>
* If there is no task defined for a calculated anomaly-degree, then the default task is
@@ -295,13 +302,6 @@ public class AnomalyDetectionPolicyDecideTaskSelectionLogic {
return pvalue;
}
- /*
- * Some utility methods
- */
- // exponential = 2(n+1)
- private static final double EMA_EXPONENT = 2.0 / (7.0 + 1.0);
- private static final double EMA_EXPONENT_1 = (1.0 - EMA_EXPONENT);
-
/**
* exponential moving average.
*