Loading de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/CodeStyleValidator.xtend +31 −13 Original line number Diff line number Diff line Loading @@ -1090,39 +1090,57 @@ class CodeStyleValidator extends AbstractDeclarativeValidator { } private def boolean isReferencedComponentSpec(ComponentDef component, EObject parent) { val variables = component.componentMembers if (!activeProfile.extendsInCheckNoOverSpecificRunsOnClauses) { variables.addAll(component.inheritedComponentMembers) } if (parent.isReferenced2(variables)) { return true } else { return false } } private def HashSet<EObject> getInheritedComponentMembers(ComponentDef component) { val HashSet<EObject> inheritedVariables = Sets.newHashSet for (e : component.extends) { inheritedVariables.addAll(e.componentMembers) inheritedVariables.addAll(e.inheritedComponentMembers) } return inheritedVariables } private def HashSet<EObject> getComponentMembers(ComponentDef component) { val HashSet<EObject> variables = Sets.newHashSet for (d : component.defs) { val element = d.element if (element.port != null) { if (element.port !== null) { for (p : element.port.instances) { variables.add(p) } } else if (element.const != null) { } else if (element.const !== null) { for (c : element.const.defs.list) { variables.add(c) } } else if (element.timer != null) { } else if (element.timer !== null) { for (t : element.timer.list.variables) { variables.add(t) } } else if (element.variable != null) { if (element.variable.list != null) { } else if (element.variable !== null) { if (element.variable.list !== null) { for (v : element.variable.list.variables) { variables.add(v) } } if (element.variable.tempList != null) { if (element.variable.tempList !== null) { for (tv : element.variable.tempList.variables) { variables.add(tv) } } } } if (parent.isReferenced2(variables)) { return true } else { return false } return variables } private def ArrayList<TTCN3Reference> findAllParameters(EObject parent) { Loading de.ugoe.cs.swe.TTCN3Configuration/src/de/ugoe/cs/swe/TTCN3Configuration/QualityCheckProfile.java +9 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ public class QualityCheckProfile extends ConfigurationProfile { private boolean checkNoInlineTemplates = true; private boolean checkNoOverSpecificRunsOnClauses = true; boolean recursionInCheckNoOverSpecificRunsOnClauses = true; private boolean extendsInCheckNoOverSpecificRunsOnClauses = false; private boolean checkNoUnusedImports = true; private boolean checkNoUnusedFormalParameters = true; private boolean checkNoUnusedLocalDefinitions = true; Loading Loading @@ -602,6 +603,14 @@ public class QualityCheckProfile extends ConfigurationProfile { this.checkNoUninitialisedVariablesExclude = checkNoUninitialisedVariablesExclude; } public boolean isExtendsInCheckNoOverSpecificRunsOnClauses() { return extendsInCheckNoOverSpecificRunsOnClauses; } public void setExtendsInCheckNoOverSpecificRunsOnClauses(boolean extendsInCheckNoOverSpecificRunsOnClauses) { this.extendsInCheckNoOverSpecificRunsOnClauses = extendsInCheckNoOverSpecificRunsOnClauses; } } Loading
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/CodeStyleValidator.xtend +31 −13 Original line number Diff line number Diff line Loading @@ -1090,39 +1090,57 @@ class CodeStyleValidator extends AbstractDeclarativeValidator { } private def boolean isReferencedComponentSpec(ComponentDef component, EObject parent) { val variables = component.componentMembers if (!activeProfile.extendsInCheckNoOverSpecificRunsOnClauses) { variables.addAll(component.inheritedComponentMembers) } if (parent.isReferenced2(variables)) { return true } else { return false } } private def HashSet<EObject> getInheritedComponentMembers(ComponentDef component) { val HashSet<EObject> inheritedVariables = Sets.newHashSet for (e : component.extends) { inheritedVariables.addAll(e.componentMembers) inheritedVariables.addAll(e.inheritedComponentMembers) } return inheritedVariables } private def HashSet<EObject> getComponentMembers(ComponentDef component) { val HashSet<EObject> variables = Sets.newHashSet for (d : component.defs) { val element = d.element if (element.port != null) { if (element.port !== null) { for (p : element.port.instances) { variables.add(p) } } else if (element.const != null) { } else if (element.const !== null) { for (c : element.const.defs.list) { variables.add(c) } } else if (element.timer != null) { } else if (element.timer !== null) { for (t : element.timer.list.variables) { variables.add(t) } } else if (element.variable != null) { if (element.variable.list != null) { } else if (element.variable !== null) { if (element.variable.list !== null) { for (v : element.variable.list.variables) { variables.add(v) } } if (element.variable.tempList != null) { if (element.variable.tempList !== null) { for (tv : element.variable.tempList.variables) { variables.add(tv) } } } } if (parent.isReferenced2(variables)) { return true } else { return false } return variables } private def ArrayList<TTCN3Reference> findAllParameters(EObject parent) { Loading
de.ugoe.cs.swe.TTCN3Configuration/src/de/ugoe/cs/swe/TTCN3Configuration/QualityCheckProfile.java +9 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ public class QualityCheckProfile extends ConfigurationProfile { private boolean checkNoInlineTemplates = true; private boolean checkNoOverSpecificRunsOnClauses = true; boolean recursionInCheckNoOverSpecificRunsOnClauses = true; private boolean extendsInCheckNoOverSpecificRunsOnClauses = false; private boolean checkNoUnusedImports = true; private boolean checkNoUnusedFormalParameters = true; private boolean checkNoUnusedLocalDefinitions = true; Loading Loading @@ -602,6 +603,14 @@ public class QualityCheckProfile extends ConfigurationProfile { this.checkNoUninitialisedVariablesExclude = checkNoUninitialisedVariablesExclude; } public boolean isExtendsInCheckNoOverSpecificRunsOnClauses() { return extendsInCheckNoOverSpecificRunsOnClauses; } public void setExtendsInCheckNoOverSpecificRunsOnClauses(boolean extendsInCheckNoOverSpecificRunsOnClauses) { this.extendsInCheckNoOverSpecificRunsOnClauses = extendsInCheckNoOverSpecificRunsOnClauses; } }