Loading de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/GenerateTTCN3.mwe2 +1 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ Workflow { composedCheck = "de.ugoe.cs.swe.validation.NamingConventionsValidator" composedCheck = "de.ugoe.cs.swe.validation.StructureOfDataValidator" composedCheck = "de.ugoe.cs.swe.validation.CodeStyleValidator" composedCheck = "de.ugoe.cs.swe.validation.DataFlowValidator" composedCheck = "de.ugoe.cs.swe.validation.ModularizationValidator" composedCheck = "de.ugoe.cs.swe.validation.LogValidator" Loading de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/DataFlowHelper.java 0 → 100644 +68 −0 Original line number Diff line number Diff line package de.ugoe.cs.swe.validation; import java.util.LinkedHashMap; import de.ugoe.cs.swe.tTCN3.SingleVarInstance; public class DataFlowHelper { public enum STATUS { UNDECLARED, DECLARED, INITIALISED, UNCERTAIN } public enum USE { DEFINE, REFERENCE } private DataFlowHelper parent; private LinkedHashMap<SingleVarInstance,STATUS> states = new LinkedHashMap<>(); public DataFlowHelper() { } public DataFlowHelper(DataFlowHelper parent) { this.parent = parent; //DONE: change to recursive lookup in parent, // store dfh for different branches and then propagate only combined to direct parent // which should be recursively propagated // - alternatively clone parent and differentiate // between parent and children if performance is poor // - this way parents will not be updated incorrectly outside // the scope of the block //this.states.putAll(parent.getStates()); } public DataFlowHelper getParent() { return parent; } public void setParent(DataFlowHelper parent) { this.parent = parent; } public LinkedHashMap<SingleVarInstance,STATUS> getStates() { return states; } // public void setStates(LinkedHashMap<SingleVarInstance,STATUS> states) { // this.states = states; // } public STATUS getState(SingleVarInstance v) { if (this.states.containsKey(v)) { return this.states.get(v); } else { if (this.parent != null) { return this.parent.getState(v); } else { return STATUS.UNDECLARED; } } } public void setState(SingleVarInstance v, STATUS s) { this.states.put(v, s); } } de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/DataFlowValidator.xtend 0 → 100644 +671 −0 File added.Preview size limit exceeded, changes collapsed. Show changes de.ugoe.cs.swe.TTCN3Configuration/src/de/ugoe/cs/swe/TTCN3Configuration/QualityCheckProfile.java +9 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public class QualityCheckProfile extends ConfigurationProfile { private boolean checkNoUnusedImports = true; private boolean checkNoUnusedFormalParameters = true; private boolean checkNoUnusedLocalDefinitions = true; private boolean checkNoUninitialisedVariables = true; private boolean checkNoLiterals = true; private boolean checkLevelOfNestedCalls = true; private int maxLevelOfNestedCalls = 4; Loading Loading @@ -575,6 +576,14 @@ public class QualityCheckProfile extends ConfigurationProfile { this.typesAndValuesImportsLibNamesRegExp = typesAndValuesImportsLibNamesRegExp; } public boolean isCheckNoUninitialisedVariables() { return checkNoUninitialisedVariables; } public void setCheckNoUninitialisedVariables(boolean checkNoUninitialisedVariables) { this.checkNoUninitialisedVariables = checkNoUninitialisedVariables; } } Loading
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/GenerateTTCN3.mwe2 +1 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ Workflow { composedCheck = "de.ugoe.cs.swe.validation.NamingConventionsValidator" composedCheck = "de.ugoe.cs.swe.validation.StructureOfDataValidator" composedCheck = "de.ugoe.cs.swe.validation.CodeStyleValidator" composedCheck = "de.ugoe.cs.swe.validation.DataFlowValidator" composedCheck = "de.ugoe.cs.swe.validation.ModularizationValidator" composedCheck = "de.ugoe.cs.swe.validation.LogValidator" Loading
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/DataFlowHelper.java 0 → 100644 +68 −0 Original line number Diff line number Diff line package de.ugoe.cs.swe.validation; import java.util.LinkedHashMap; import de.ugoe.cs.swe.tTCN3.SingleVarInstance; public class DataFlowHelper { public enum STATUS { UNDECLARED, DECLARED, INITIALISED, UNCERTAIN } public enum USE { DEFINE, REFERENCE } private DataFlowHelper parent; private LinkedHashMap<SingleVarInstance,STATUS> states = new LinkedHashMap<>(); public DataFlowHelper() { } public DataFlowHelper(DataFlowHelper parent) { this.parent = parent; //DONE: change to recursive lookup in parent, // store dfh for different branches and then propagate only combined to direct parent // which should be recursively propagated // - alternatively clone parent and differentiate // between parent and children if performance is poor // - this way parents will not be updated incorrectly outside // the scope of the block //this.states.putAll(parent.getStates()); } public DataFlowHelper getParent() { return parent; } public void setParent(DataFlowHelper parent) { this.parent = parent; } public LinkedHashMap<SingleVarInstance,STATUS> getStates() { return states; } // public void setStates(LinkedHashMap<SingleVarInstance,STATUS> states) { // this.states = states; // } public STATUS getState(SingleVarInstance v) { if (this.states.containsKey(v)) { return this.states.get(v); } else { if (this.parent != null) { return this.parent.getState(v); } else { return STATUS.UNDECLARED; } } } public void setState(SingleVarInstance v, STATUS s) { this.states.put(v, s); } }
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/DataFlowValidator.xtend 0 → 100644 +671 −0 File added.Preview size limit exceeded, changes collapsed. Show changes
de.ugoe.cs.swe.TTCN3Configuration/src/de/ugoe/cs/swe/TTCN3Configuration/QualityCheckProfile.java +9 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public class QualityCheckProfile extends ConfigurationProfile { private boolean checkNoUnusedImports = true; private boolean checkNoUnusedFormalParameters = true; private boolean checkNoUnusedLocalDefinitions = true; private boolean checkNoUninitialisedVariables = true; private boolean checkNoLiterals = true; private boolean checkLevelOfNestedCalls = true; private int maxLevelOfNestedCalls = 4; Loading Loading @@ -575,6 +576,14 @@ public class QualityCheckProfile extends ConfigurationProfile { this.typesAndValuesImportsLibNamesRegExp = typesAndValuesImportsLibNamesRegExp; } public boolean isCheckNoUninitialisedVariables() { return checkNoUninitialisedVariables; } public void setCheckNoUninitialisedVariables(boolean checkNoUninitialisedVariables) { this.checkNoUninitialisedVariables = checkNoUninitialisedVariables; } }