summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-analytics
diff options
context:
space:
mode:
authorRupinder <rupinsi1@in.ibm.com>2020-04-08 13:25:54 +0530
committerRupinderjeet Singh <rupinsi1@in.ibm.com>2020-04-08 08:09:26 +0000
commit5e9527d6e9cdf60b7ea4118e98ebac064d52c87d (patch)
treef3211d860501cbc55dac0590d102b9860993e6bc /ecomp-sdk/epsdk-analytics
parent4fe4c6992c81e236f16167ce0027ecdc5d837c15 (diff)
removed some code smells
Atmost 1 statement is allowed per line so moved the 2nd statement to next line Issue-ID: PORTAL-865 Change-Id: I7f6ba50c2e6b1d8af4f3c1fedc03e00eac16b775 Signed-off-by: Rupinder<rupinsi1@in.ibm.com>
Diffstat (limited to 'ecomp-sdk/epsdk-analytics')
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java165
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormField.java3
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormatProcessor.java6
3 files changed, 115 insertions, 59 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java
index 29cbca18..6003222b 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java
@@ -995,7 +995,8 @@ public class ChartJSONHelper {
} else if (filter == 1 && (dc.isCreateInNewChart()==null || !dc.isCreateInNewChart().booleanValue())) {
chartValueCols.add(dc);
}
- else if(filter == 0) chartValueCols.add(dc);
+ else if(filter == 0)
+ chartValueCols.add(dc);
} else chartValueCols.add(dc);
}
// } else
@@ -1067,113 +1068,138 @@ public class ChartJSONHelper {
*/
date = MMDDYYYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
if(date==null) {
date = EEEMMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYOFTHEWEEKFLAG;
+ if(date!=null)
+ formatFlag = DAYOFTHEWEEKFLAG;
}
if(date==null) {
date = MMDDYYYYHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
//MMDDYYYYHHFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
date = MMDDYYYYHHFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = HOURFLAG;
+ if(date!=null)
+ formatFlag = HOURFLAG;
}
if(date==null) {
date = MMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = YYYYMMDDFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = timestampFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = timestampHrFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = HOURFLAG;
+ if(date!=null)
+ formatFlag = HOURFLAG;
}
if(date==null) {
date = timestampDayFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = MONYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MONTHFLAG;
+ if(date!=null)
+ formatFlag = MONTHFLAG;
}
if(date==null) {
date = MMYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MONTHFLAG;
+ if(date!=null)
+ formatFlag = MONTHFLAG;
}
if(date==null) {
date = MMMMMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = MONTHYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MONTHFLAG;
+ if(date!=null)
+ formatFlag = MONTHFLAG;
}
if(date==null) {
date = YYYYMMDDHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = YYYYMMDDHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = DDMONYYYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = DDMONYYYYHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = DDMONYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = MMDDYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = MMDDYYHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = MMDDYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = timestampFormat1.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = MMDDYYYYHHMMZFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = YYYYFormat.parse(dateStr, new ParsePosition(0));
/* Some random numbers should not satisfy this year format. */
- if(dateStr.length()>4) date = null;
- if(date!=null) formatFlag = YEARFLAG;
+ if(dateStr.length()>4)
+ date = null;
+ if(date!=null)
+ formatFlag = YEARFLAG;
}
if(date==null)
date = null;
@@ -1230,112 +1256,137 @@ public class ChartJSONHelper {
*/
date = MMDDYYYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
if(date==null) {
date = EEEMMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYOFTHEWEEKFLAG;
+ if(date!=null)
+ formatFlag = DAYOFTHEWEEKFLAG;
}
if(date==null) {
date = MMDDYYYYHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
//MMDDYYYYHHFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
date = MMDDYYYYHHFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = HOURFLAG;
+ if(date!=null)
+ formatFlag = HOURFLAG;
}
if(date==null) {
date = MMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = YYYYMMDDFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = timestampFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = timestampHrFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = HOURFLAG;
+ if(date!=null)
+ formatFlag = HOURFLAG;
}
if(date==null) {
date = timestampDayFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = MONYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MONTHFLAG;
+ if(date!=null)
+ formatFlag = MONTHFLAG;
}
if(date==null) {
date = MMYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MONTHFLAG;
+ if(date!=null)
+ formatFlag = MONTHFLAG;
}
if(date==null) {
date = MMMMMDDYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = MONTHYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MONTHFLAG;
+ if(date!=null)
+ formatFlag = MONTHFLAG;
}
if(date==null) {
date = YYYYMMDDHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = YYYYMMDDHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = DDMONYYYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = DDMONYYYYHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = DDMONYYYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = MMDDYYHHMMSSFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = MMDDYYHHMMFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = MMDDYYFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = DAYFLAG;
+ if(date!=null)
+ formatFlag = DAYFLAG;
}
if(date==null) {
date = timestampFormat1.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = SECFLAG;
+ if(date!=null)
+ formatFlag = SECFLAG;
}
if(date==null) {
date = MMDDYYYYHHMMZFormat.parse(dateStr, new ParsePosition(0));
- if(date!=null) formatFlag = MINFLAG;
+ if(date!=null)
+ formatFlag = MINFLAG;
}
if(date==null) {
date = YYYYFormat.parse(dateStr, new ParsePosition(0));
/* Some random numbers should not satisfy this year format. */
- if(dateStr.length()>4) date = null;
- if(date!=null) formatFlag = YEARFLAG;
+ if(dateStr.length()>4)
+ date = null;
+ if(date!=null)
+ formatFlag = YEARFLAG;
}
if(date==null)
date = null;
@@ -1362,8 +1413,10 @@ public class ChartJSONHelper {
public boolean getBooleanValue(String s, Boolean defaultValue) {
s = nvl(s);
- if(s.length()<=0 && defaultValue!=null) return defaultValue.booleanValue();
- else if(s.length()<=0) return false;
+ if(s.length()<=0 && defaultValue!=null)
+ return defaultValue.booleanValue();
+ else if(s.length()<=0)
+ return false;
else {
if(s.toUpperCase().startsWith("Y") || s.toLowerCase().equals("true"))
return true;
@@ -1468,7 +1521,8 @@ public class ChartJSONHelper {
value.append("(");
}
for(int j = 0 ; j < vals.length; j++) {
- if(isMultiValue) value.append("'");
+ if(isMultiValue)
+ value.append("'");
try {
if(vals[j] !=null && vals[j].length() > 0) {
vals[j] = Utils.oracleSafe(vals[j]);
@@ -1483,7 +1537,8 @@ public class ChartJSONHelper {
}
- if(isMultiValue) value.append("'");
+ if(isMultiValue)
+ value.append("'");
if(j != vals.length -1) {
value.append(",");
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormField.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormField.java
index 178410ab..3af59e56 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormField.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormField.java
@@ -70,7 +70,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+import java.util.regex.Pattern;
import org.onap.portalsdk.analytics.error.RaptorRuntimeException;
import org.onap.portalsdk.analytics.error.UserDefinedException;
@@ -80,7 +80,6 @@ import org.onap.portalsdk.analytics.model.base.IdNameSql;
import org.onap.portalsdk.analytics.model.base.IdNameValue;
import org.onap.portalsdk.analytics.system.AppUtils;
import org.onap.portalsdk.analytics.system.ConnectionUtils;
-import org.onap.portalsdk.analytics.system.ExecuteQuery;
import org.onap.portalsdk.analytics.system.Globals;
import org.onap.portalsdk.analytics.util.DataSet;
import org.onap.portalsdk.analytics.util.Utils;
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormatProcessor.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormatProcessor.java
index b0eb81a3..0805b22c 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormatProcessor.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormatProcessor.java
@@ -274,7 +274,8 @@ public class FormatProcessor extends RaptorObject {
}
}
- if( anyFormatter == null ) anyFormatter = formatter;
+ if( anyFormatter == null )
+ anyFormatter = formatter;
// String sValue = convertValue(dv.getDisplayValue());
//if (sValue.length() > 0) {
for (Iterator iter = semaphore.getFormatList().getFormat().iterator(); iter
@@ -319,7 +320,8 @@ public class FormatProcessor extends RaptorObject {
//dr.setFormatId(fmt.getFormatId());
//break;
} else { // if
- if(!formatModified) formatter = anyFormatter;
+ if(!formatModified)
+ formatter = anyFormatter;
//if(!((formatter!=null && formatter!=anyFormatter) || (defaultFormatter!=null && formatter!=defaultFormatter)))
// formatter = anyFormatter;
//formatter.setFormatId(anyFormatter.getFormatId());