SqlServer

SqlServer Rules

Category Severity Name Description
Maintainability Major @@IDENTITY should not be used @@IDENTITY should not be used
Maintainability Critical A primary key should be specified during table creation A primary key should be specified during table creation
Bug Major All branches in a conditional structure should not have exactly the same implementation All branches in a conditional structure should not have exactly the same implementation
Maintainability Major ANSI_NULLS, ANSI_PADDING and CONCAT_NULL_YIELDS_NULL should not be configured ANSI_NULLS, ANSI_PADDING and CONCAT_NULL_YIELDS_NULL should not be configured
Maintainability Minor Boolean checks should not be inverted Boolean checks should not be inverted
Maintainability Critical CASE expressions should end with ELSE clauses CASE expressions should end with ELSE clauses
Maintainability Major CASE expressions should not have too many WHEN clauses CASE expressions should not have too many WHEN clauses
Bug Critical CASE input expressions should be invariant CASE input expressions should be invariant
Maintainability Minor CATCH clauses should do more than rethrow CATCH clauses should do more than rethrow
Maintainability Major COALESCE, IIF, and CASE input expressions should not contain subqueries COALESCE, IIF, and CASE input expressions should not contain subqueries
Maintainability Major Collapsible if statements should be merged Collapsible if statements should be merged
Maintainability Major Column names should be used in an ORDER BY clause Column names should be used in an ORDER BY clause
Maintainability Minor Column references should not have more than two-parts Column references should not have more than two-parts
Maintainability Major Columns to be read with a SELECT statement should be clearly defined Columns to be read with a SELECT statement should be clearly defined
Maintainability Critical Conditionally executed code should be denoted by either indentation or BEGIN...END block Conditionally executed code should be denoted by either indentation or BEGIN...END block
Maintainability Critical Conditionals should start on new lines Conditionals should start on new lines
Maintainability Critical Control flow statements IF, WHILE and TRY should not be nested too deeply Control flow statements IF, WHILE and TRY should not be nested too deeply
Maintainability Critical Control structures should use BEGIN...END blocks Control structures should use BEGIN...END blocks
Bug Critical DELETE and UPDATE statements should contain WHERE clauses DELETE and UPDATE statements should contain WHERE clauses
Maintainability Major Deprecated features should not be used Deprecated features should not be used
Maintainability Major Deprecated system tables and views should not be used Deprecated system tables and views should not be used
Maintainability Major Duplicate values should not be passed as arguments Duplicate values should not be passed as arguments
SecurityWarning Critical Dynamically executing code is security-sensitive Dynamically executing code is security-sensitive
Maintainability Minor Empty statements should be removed Empty statements should be removed
Maintainability Critical Expressions should not be too complex Expressions should not be too complex
Maintainability Major Files should not have too many lines of code Files should not have too many lines of code
Maintainability Major Function and procedure names should comply with a naming convention Function and procedure names should comply with a naming convention
Maintainability Major Functions and procedures should not have too many parameters Functions and procedures should not have too many parameters
Maintainability Major Functions and stored procedure should not have too many lines of code Functions and stored procedure should not have too many lines of code
Maintainability Major GOTO statements should not be used GOTO statements should not be used
Bug Major Identical expressions should not be used on both sides of a binary operator Identical expressions should not be used on both sides of a binary operator
Maintainability Critical IF ... ELSEIF constructs should end with ELSE clauses IF ... ELSEIF constructs should end with ELSE clauses
Maintainability Critical INSERT statements should explicitly list the columns to be set INSERT statements should explicitly list the columns to be set
Bug Major Jump statements should not be followed by dead code Jump statements should not be followed by dead code
Maintainability Minor Jump statements should not be redundant Jump statements should not be redundant
Maintainability Minor LIKE clauses should not be used without wildcards LIKE clauses should not be used without wildcards
Maintainability Major LIKE clauses should not start with wildcard characters LIKE clauses should not start with wildcard characters
Maintainability Major Lines should not be too long Lines should not be too long
Maintainability Minor Local variable and parameter names should comply with a naming convention Local variable and parameter names should comply with a naming convention
Bug Major Loops with at most one iteration should be refactored Loops with at most one iteration should be refactored
Maintainability Major Multiline blocks should be enclosed in BEGIN...END blocks Multiline blocks should be enclosed in BEGIN...END blocks
Maintainability Minor Multiple variables should not be declared on the same line Multiple variables should not be declared on the same line
Maintainability Critical NOCOUNT should be activated on PROCEDURE and TRIGGER definitions NOCOUNT should be activated on PROCEDURE and TRIGGER definitions
Maintainability Minor Non-standard comparison operators should not be used Non-standard comparison operators should not be used
Bug Major NULL should not be compared directly NULL should not be compared directly
Bug Critical Nullable subqueries should not be used in NOT IN conditions Nullable subqueries should not be used in NOT IN conditions
Bug Major Output parameters should be assigned Output parameters should be assigned
Maintainability Major Queries should not join too many tables Queries should not join too many tables
Bug Major Queries that use TOP should have an ORDER BY Queries that use TOP should have an ORDER BY
Maintainability Major Redundant pairs of parentheses should be removed Redundant pairs of parentheses should be removed
Bug Major Related IF/ELSE IF statements and WHEN clauses in a CASE should not have the same condition Related IF/ELSE IF statements and WHEN clauses in a CASE should not have the same condition
Maintainability Minor Reserved keywords should not be used as identifiers or object names Reserved keywords should not be used as identifiers or object names
Maintainability Critical SELECT statements used as argument of EXISTS statements should be selective SELECT statements used as argument of EXISTS statements should be selective
Vulnerability Critical SHA-1 and Message-Digest hash algorithms should not be used in secure contexts SHA-1 and Message-Digest hash algorithms should not be used in secure contexts
Maintainability Critical Size should be specified for varchar variables and parameters Size should be specified for varchar variables and parameters
Maintainability Major Statements should be on separate lines Statements should be on separate lines
Maintainability Critical String literals should not be duplicated String literals should not be duplicated
Maintainability Major Tabulation characters should not be used Tabulation characters should not be used
Bug Critical The number of variables in a FETCH statement should match the number of columns in the cursor The number of variables in a FETCH statement should match the number of columns in the cursor
Maintainability Major Track lack of SQL Server session configuration Track lack of SQL Server session configuration
Maintainability Major Track uses of FIXME tags Track uses of FIXME tags
Maintainability Information Track uses of TODO tags Track uses of TODO tags
Maintainability Minor Triggers should not PRINT, SELECT, or FETCH Triggers should not PRINT, SELECT, or FETCH
Maintainability Major Two branches in a conditional structure should not have exactly the same implementation Two branches in a conditional structure should not have exactly the same implementation
Bug Major Unary prefix operators should not be repeated Unary prefix operators should not be repeated
Maintainability Minor Unused local variables should be removed Unused local variables should be removed
Maintainability Major Unused procedure and function parameters should be removed Unused procedure and function parameters should be removed
SecurityWarning Minor Using hardcoded IP addresses is security-sensitive Using hardcoded IP addresses is security-sensitive
Bug Major Variables should not be self-assigned Variables should not be self-assigned
Maintainability Major WHEN clauses should not have too many lines of code WHEN clauses should not have too many lines of code
Bug Major WHERE clause conditions should not be contradictory WHERE clause conditions should not be contradictory
Bug Major WHERE clauses should not contain redundant conditions WHERE clauses should not contain redundant conditions