Informix Scan rules
Contrast Scan supports these rules for Informix.
Severity | Contrast rule | Engine rule ID | Description |
---|---|---|---|
Critical | Avoid Correlated Sub Selects | OPT.INFORMIX.AvoidCorrelatedSubSelects | AvoidCorrelatedSubSelects: Avoid nested SELECTs that use columns defined in outer SELECTs |
Critical | Cursor For Update Where Current | OPT.INFORMIX.CursorForUpdateWhereCurrent | CursorForUpdateWhereCurrent: If a CURSOR is declared FOR UPDATE, DELETE and UPDATE must be used with the WHERE CURRENT specification |
Critical | Detect Unaware Cross Joins | OPT.INFORMIX.DetectUnawareCrossJoins | DetectUnawareCrossJoins: Do not make "unnoticed" cartesian products in queries |
Critical | Dont Select Known Fields | OPT.INFORMIX.DontSelectKnownFields | DontSelectKnownFields: SELECT queries never should get fields used in the WHERE specification with {} |
Critical | Fetch And Declare Same Fields | OPT.INFORMIX.FetchAndDeclareSameFields | FetchAndDeclareSameFields: The number of fields to retrieve specified in the DECLARE CURSOR statement must be the same as the number of fields specified in the FETCH statement |
High | Avoid Declared Unopened Cursors | OPT.INFORMIX.AvoidDeclaredUnopenedCursors | AvoidDeclaredUnopenedCursors: If a CURSOR is declared, it must be opened |
High | Avoid Numeric References In By Clauses | OPT.INFORMIX.AvoidNumericReferencesInByClauses | AvoidNumericReferencesInByClauses: Do not refer to column names with number indexes in * BY clauses |
High | Avoid Opened Unclosed Cursors | OPT.INFORMIX.AvoidOpenedUnclosedCursors | AvoidOpenedUnclosedCursors: If a CURSOR is opened, it must be closed |
High | Avoid Opened Unused Cursors | OPT.INFORMIX.AvoidOpenedUnusedCursors | AvoidOpenedUnusedCursors: If a CURSOR is opened, it must be used |
High | Avoid Union | OPT.INFORMIX.AvoidUnion | AvoidUnion: Avoid selects with UNION |
High | No Current Clause | OPT.INFORMIX.NoCurrentClause | NoCurrentClause: SQL queries with CURRENT clause are heavy-weighted and must be used only when necessary |
High | Unused Local Var | OPT.INFORMIX.UnusedLocalVar | UnusedLocalVar: Avoid unused local variables |
High | Unused Parameter | OPT.INFORMIX.UnusedParameter | UnusedParameter: Avoid unused function or procedure parameter |
High | Use The As Keyword | OPT.INFORMIX.UseTheAsKeyword | UseTheAsKeyword: Use AS keyword when stablishing an alias to tables |
Info | Avoid Concat Operator | OPT.INFORMIX.AvoidConcatOperator | AvoidConcatOperator: Do not use concatenation operator |
Info | Avoid Non Declared Cursor | OPT.INFORMIX.AvoidNonDeclaredCursor | AvoidNonDeclaredCursor: Use of cursor not previously declared |
Low | Avoid Goto Statement | OPT.INFORMIX.AvoidGotoStatement | AvoidGotoStatement: Avoid using GOTO statement |
Low | Avoid Host Operations | OPT.INFORMIX.AvoidHostOperations | AvoidHostOperations: Do not perform arithmetic operations in the WHERE clause |
Low | Avoid Insert Without Fields Specification | OPT.INFORMIX.AvoidInsertWithoutFieldsSpecification | AvoidInsertWithoutFieldsSpecification: Every INSERT statement must include the field specification (i.e : INSERT INTO table(column1,column2) VALUES (value1,value2)) |
Low | Avoid Scroll Cursors | OPT.INFORMIX.AvoidScrollCursors | AvoidScrollCursors: Avoid scroll cursors when possible |
Low | Avoid Update Asterisk | OPT.INFORMIX.AvoidUpdateAsterisk | AvoidUpdateAsterisk: Avoid UPDATE with asterisk target |
Low | Avoid Whenever | OPT.INFORMIX.AvoidWhenever | AvoidWhenever: Do not use WHENEVER clause |
Low | Check Simple Condition | OPT.INFORMIX.CheckSimpleCondition | CheckSimpleCondition: Simplify WHERE clause conditions |
Low | Dead Code | OPT.INFORMIX.DeadCode | DeadCode: Check and remove unreachable code |
Low | Do Not Use Negation In Where | OPT.INFORMIX.DoNotUseNegationInWhere | DoNotUseNegationInWhere: Do not use negation operator |
Low | Else In Case Statement | OPT.INFORMIX.ElseInCaseStatement | ElseInCaseStatement: Include an ELSE clause in CASE statements |
Low | Insert Cursor In Loop | OPT.INFORMIX.InsertCursorInLoop | InsertCursorInLoop: Use INSERT cursors within loops |
Low | Nested If Statements | OPT.INFORMIX.NestedIfStatements | NestedIfStatements: Avoid too deep IF statements nesting |
Low | One SQL Statement Per Line | OPT.INFORMIX.OneSQLStatementPerLine | OneSQLStatementPerLine: Only write a SQL statement per line |
Low | Too Many Cases In Case | OPT.INFORMIX.TooManyCasesInCase | TooManyCasesInCase: Avoid a high number of WHEN clauses in a CASE statement |
Low | Too Many Lines In Function | OPT.INFORMIX.TooManyLinesInFunction | TooManyLinesInFunction: Avoid functions or procedures with too many lines |
Low | Use Let Instead Of Initialize | OPT.INFORMIX.UseLetInsteadOfInitialize | UseLetInsteadOfInitialize: Use LET instead of INITIALIZE |
Medium | Avoid Natural Joins | OPT.INFORMIX.AvoidNaturalJoins | AvoidNaturalJoins: NATURAL JOINs are buggy and unmaintenable |
Medium | Avoid Nested Selects | OPT.INFORMIX.AvoidNestedSelects | AvoidNestedSelects: Avoid nested selects |
Medium | Avoid Queries On Many Tables | OPT.INFORMIX.AvoidQueriesOnManyTables | AvoidQueriesOnManyTables: Avoid JOIN queries referencing too many tables |
Medium | Avoid Select Asterisk | OPT.INFORMIX.AvoidSelectAsterisk | AvoidSelectAsterisk: Do not use SELECT * |
Medium | Avoid Too Many Joins | OPT.INFORMIX.AvoidTooManyJoins | AvoidTooManyJoins: Avoid queries with too many JOINs |
Medium | Fully Qualified Names In Columns | OPT.INFORMIX.FullyQualifiedNamesInColumns | FullyQualifiedNamesInColumns: Use qualified names when referring to column names |