Loading de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/CodeStyleValidator.xtend +17 −5 Original line number Diff line number Diff line Loading @@ -61,6 +61,8 @@ import de.ugoe.cs.swe.tTCN3.TimerRefOrAny import de.ugoe.cs.swe.tTCN3.Type import de.ugoe.cs.swe.tTCN3.TypeDef import de.ugoe.cs.swe.tTCN3.UnionDefNamed import de.ugoe.cs.swe.tTCN3.Value import de.ugoe.cs.swe.tTCN3.ValueofOp import de.ugoe.cs.swe.tTCN3.VarList import java.util.ArrayList import java.util.HashMap Loading @@ -86,8 +88,8 @@ import static extension de.ugoe.cs.swe.common.TTCN3ReferenceHelper.* import static extension de.ugoe.cs.swe.common.TTCN3ScopeHelper.* import static extension org.eclipse.emf.ecore.util.EcoreUtil.* import static extension org.eclipse.xtext.EcoreUtil2.* import de.ugoe.cs.swe.tTCN3.ValueofOp import de.ugoe.cs.swe.tTCN3.Value import org.eclipse.xtext.EcoreUtil2.ElementReferenceAcceptor import org.eclipse.emf.ecore.EReference class CheckDefinitionComeFirstParameter { public boolean hasOtherDefinitions Loading Loading @@ -870,13 +872,19 @@ class CodeStyleValidator extends AbstractDeclarativeValidator { @Check def checkNoValueOfForValues(ValueofOp templateOp) { //TODO: add property, update version // if (!activeProfile.checkNoValueOfForValues) // return; if (!activeProfile.checkNoValueOfForValues) return; // only consider templates with a type // if (template.type == null) // return; //guards if (templateOp.template.template.simple === null || templateOp.template.template.simple.expr === null ) { return } //TODO: overly specific.. val expr = templateOp.template.template.simple.expr // .ref.head Loading @@ -885,13 +893,16 @@ class CodeStyleValidator extends AbstractDeclarativeValidator { if (expr.ref.referencedValue instanceof SingleTempVarInstance) { return } if (expr.ref.referencedValue instanceof FormalTemplatePar) { return } //TODO: other conditions? } else { //TODO: check further? return } } else { //TODO: check further? //TODO: check further? e.g. function return types? return } statistics.incrementCountStyle Loading Loading @@ -1017,6 +1028,7 @@ class CodeStyleValidator extends AbstractDeclarativeValidator { info( message, f, // consideredAltOrFunc.first, null, MessageClass.STYLE.toString, node.startLine.toString, Loading Loading
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/CodeStyleValidator.xtend +17 −5 Original line number Diff line number Diff line Loading @@ -61,6 +61,8 @@ import de.ugoe.cs.swe.tTCN3.TimerRefOrAny import de.ugoe.cs.swe.tTCN3.Type import de.ugoe.cs.swe.tTCN3.TypeDef import de.ugoe.cs.swe.tTCN3.UnionDefNamed import de.ugoe.cs.swe.tTCN3.Value import de.ugoe.cs.swe.tTCN3.ValueofOp import de.ugoe.cs.swe.tTCN3.VarList import java.util.ArrayList import java.util.HashMap Loading @@ -86,8 +88,8 @@ import static extension de.ugoe.cs.swe.common.TTCN3ReferenceHelper.* import static extension de.ugoe.cs.swe.common.TTCN3ScopeHelper.* import static extension org.eclipse.emf.ecore.util.EcoreUtil.* import static extension org.eclipse.xtext.EcoreUtil2.* import de.ugoe.cs.swe.tTCN3.ValueofOp import de.ugoe.cs.swe.tTCN3.Value import org.eclipse.xtext.EcoreUtil2.ElementReferenceAcceptor import org.eclipse.emf.ecore.EReference class CheckDefinitionComeFirstParameter { public boolean hasOtherDefinitions Loading Loading @@ -870,13 +872,19 @@ class CodeStyleValidator extends AbstractDeclarativeValidator { @Check def checkNoValueOfForValues(ValueofOp templateOp) { //TODO: add property, update version // if (!activeProfile.checkNoValueOfForValues) // return; if (!activeProfile.checkNoValueOfForValues) return; // only consider templates with a type // if (template.type == null) // return; //guards if (templateOp.template.template.simple === null || templateOp.template.template.simple.expr === null ) { return } //TODO: overly specific.. val expr = templateOp.template.template.simple.expr // .ref.head Loading @@ -885,13 +893,16 @@ class CodeStyleValidator extends AbstractDeclarativeValidator { if (expr.ref.referencedValue instanceof SingleTempVarInstance) { return } if (expr.ref.referencedValue instanceof FormalTemplatePar) { return } //TODO: other conditions? } else { //TODO: check further? return } } else { //TODO: check further? //TODO: check further? e.g. function return types? return } statistics.incrementCountStyle Loading Loading @@ -1017,6 +1028,7 @@ class CodeStyleValidator extends AbstractDeclarativeValidator { info( message, f, // consideredAltOrFunc.first, null, MessageClass.STYLE.toString, node.startLine.toString, Loading