This project is read-only.
TSQLSmellsSCA.cs is the starting point for each rule and has numerous similar classes such as the below that are discoverable by SSDT. These are all relatively simple in that they use the TSQLSmellWorker class to analyse the in memory schema model ( SqlRuleExecutionContext.SchemaModel ) and returns a list of problems.

Each rule, unfortunately, does test for all of the problems for which the problems we are then not look for are rejected. This is not ideal, but refactoring to allow for this is a lot of work.

        RuleConstants.ResourceBaseName, // Name of the resource file to look up displayname and description in
        RuleConstants.TSQLSmell_RuleName01, // ID used to look up the display name inside the resources file
        // ID used to look up the description inside the resources file
        Category = RuleConstants.CategorySmells,
        RuleScope = SqlRuleScope.Model)] // This rule targets the whole model
    public sealed class TSQLSmellSCA : SqlCodeAnalysisRule

        public const string RuleId = "Smells.SML001";
        public override IList<SqlRuleProblem> Analyze(SqlRuleExecutionContext context)
            TSQLSmellWorker Worker = new TSQLSmellWorker(context, RuleId);
            return (Worker.Analyze());


Last edited May 8, 2014 at 8:10 AM by daveballantyne, version 1