public void ProcessColumnDefinition(ColumnDefinition ColumnDef) { _smells.ProcessTsqlFragment(ColumnDef.DataType); foreach (var Constraint in ColumnDef.Constraints) { _smells.ProcessTsqlFragment(Constraint); } }
public void ProcessIfStatement(IfStatement IfStatement) { _smells.ProcessTsqlFragment(IfStatement.Predicate); _smells.ProcessTsqlFragment(IfStatement.ThenStatement); if (IfStatement.ElseStatement != null) { _smells.ProcessTsqlFragment(IfStatement.ElseStatement); } }
public void ProcessDeclareVariableElement(DeclareVariableElement Element) { if (Element.VariableName.Value.Length <= 2) { _smells.SendFeedBack(33, Element); } _smells.ProcessTsqlFragment(Element.DataType); if (Element.Value != null) { _smells.ProcessTsqlFragment(Element.Value); } }
public void ProcessBeginEndBlockStatement(BeginEndBlockStatement BEStatement) { foreach (TSqlStatement Statement in BEStatement.StatementList.Statements) { _smells.ProcessTsqlFragment(Statement); } }
public void ProcessReturnStatement(ReturnStatement ReturnStatement) { if (ReturnStatement.Expression != null) { _smells.ProcessTsqlFragment(ReturnStatement.Expression); } }
public void ProcessFunctionStatementBody(FunctionStatementBody Function) { if (Function.Name.SchemaIdentifier == null) { _smells.SendFeedBack(24, Function.Name); } _smells.ProcessTsqlFragment(Function.ReturnType); if (Function.StatementList != null) { foreach (TSqlFragment Statement in Function.StatementList.Statements) { _smells.ProcessTsqlFragment(Statement); } } }
public void ProcessProcedureStatementBody(ProcedureStatementBody StatementBody) { _smells.AssignmentList.Clear(); TestProcedureReference(StatementBody.ProcedureReference); ParameterList = StatementBody.Parameters; NoCountSet = false; if (StatementBody.StatementList != null) { foreach (TSqlFragment Fragment in StatementBody.StatementList.Statements) { _smells.ProcessTsqlFragment(Fragment); } if (!NoCountSet) { _smells.SendFeedBack(30, StatementBody.ProcedureReference); } } ParameterList = null; }
public void ProcessWhileStatement(WhileStatement whileStatement) { _smells.ProcessTsqlFragment(whileStatement.Predicate); _smells.ProcessTsqlFragment(whileStatement.Statement); }
public void ProcessTableValuedFunctionReturnType(TableValuedFunctionReturnType Fragment) { _smells.ProcessTsqlFragment(Fragment.DeclareTableVariableBody); }
public void ProcessCreateTable(CreateTableStatement TblStmt) { bool isTemp = TblStmt.SchemaObjectName.BaseIdentifier.Value.StartsWith("#") || TblStmt.SchemaObjectName.BaseIdentifier.Value.StartsWith("@"); if (TblStmt.SchemaObjectName.SchemaIdentifier == null && !isTemp ) { _smells.SendFeedBack(27, TblStmt); } { foreach (ColumnDefinition colDef in TblStmt.Definition.ColumnDefinitions) { _smells.ProcessTsqlFragment(colDef); } } if (isTemp) { foreach (ConstraintDefinition constDef in TblStmt.Definition.TableConstraints) { if (constDef.ConstraintIdentifier != null) { } switch (FragmentTypeParser.GetFragmentType(constDef)) { case "UniqueConstraintDefinition": UniqueConstraintDefinition unqConst = (UniqueConstraintDefinition)constDef; if (unqConst.IsPrimaryKey) { _smells.SendFeedBack(38, constDef); } break; } } foreach (ColumnDefinition colDef in TblStmt.Definition.ColumnDefinitions) { if (colDef.DefaultConstraint != null && colDef.DefaultConstraint.ConstraintIdentifier != null) { _smells.SendFeedBack(39, colDef); } foreach (ConstraintDefinition constDef in colDef.Constraints) { if (constDef.ConstraintIdentifier != null) { } switch (FragmentTypeParser.GetFragmentType(constDef)) { case "CheckConstraintDefinition": CheckConstraintDefinition chkConst = (CheckConstraintDefinition)constDef; if (chkConst.ConstraintIdentifier != null) { _smells.SendFeedBack(40, chkConst);; } break; } } } } }
public void ProcessSelectFunctionReturnType(SelectFunctionReturnType ReturnType) { _smells.ProcessTsqlFragment(ReturnType.SelectStatement); }