NATURAL Scan rules
Contrast Scan supports these rules for NATURAL.
Severity | Contrast rule | Engine rule ID | Description |
---|---|---|---|
Critical | Avoid Input Using Map Inside Read Find | OPT.NATURAL.NAT_PF.AvoidInputUsingMapInsideReadFind | AvoidInputUsingMapInsideReadFind: Avoid records locking for user input |
High | Avoid Too Complex Routines | OPT.NATURAL.NAT_MAN.AvoidTooComplexRoutines | AvoidTooComplexRoutines: Avoid too complex programmes (in cyclomatic complexity, number of different execution ways) |
High | Only Allowed Copy Codes | OPT.NATURAL.NAT_MAN.OnlyAllowedCopyCodes | OnlyAllowedCopyCodes: Limit the copy codes to be used |
High | Unused Data Area | OPT.NATURAL.NAT_MAN.UnusedDataArea | UnusedDataArea: Avoid unused data areas (local, global or parameter) in system |
High | Unused Maps | OPT.NATURAL.NAT_MAN.UnusedMaps | UnusedMaps: Avoid unused maps / forms declarations in system |
High | Unused Routines | OPT.NATURAL.NAT_MAN.UnusedRoutines | UnusedRoutines: Avoid unused routines or programs in system |
High | Avoid D M L Out Of Transaction Context | OPT.NATURAL.NAT_PB.AvoidDMLOutOfTransactionContext | AvoidDMLOutOfTransactionContext: Check that every DML statement has its corresponding END TRANSACTION |
High | Avoid Empty None Clause | OPT.NATURAL.NAT_PB.AvoidEmptyNoneClause | AvoidEmptyNoneClause: Avoid empty NONE clauses in the DECIDE ON/FOR statement in programmes |
High | Avoid Empty On Error Clause | OPT.NATURAL.NAT_PB.AvoidEmptyOnErrorClause | AvoidEmptyOnErrorClause: It's advisable to not code empty ON ERROR to handle correctly every possible error |
High | Avoid Stack Usages | OPT.NATURAL.NAT_PB.AvoidStackUsages | AvoidStackUsages: Avoid using STACK sentence |
High | Avoid Find Sorted By | OPT.NATURAL.NAT_PF.AvoidFindSortedBy | AvoidFindSortedBy: Do not use option SORTED BY in FIND statements |
High | Use With Limit Clause In Read And Find | OPT.NATURAL.NAT_PF.UseWithLimitClauseInReadAndFind | UseWithLimitClauseInReadAndFind: Limit the amount of records used in READ and FIND |
Info | Avoid Multiple Sentences In One Line | OPT.NATURAL.NAT_DOC.AvoidMultipleSentencesInOneLine | AvoidMultipleSentencesInOneLine: Avoid writing multiple sentences in one code line |
Info | Avoid Too Large Code Blocks | OPT.NATURAL.NAT_MAN.AvoidTooLargeCodeBlocks | AvoidTooLargeCodeBlocks: Certain code structures (LDA, PDA, programs or subroutines) should not exceed a maximum number of lines |
Info | Remove Commented Code | OPT.NATURAL.NAT_MAN.RemoveCommentedCode | RemoveCommentedCode: Avoid commented code |
Info | Program Name | OPT.NATURAL.NAT_NOM.ProgramName | ProgramName: Follow programmes naming standard |
Info | Subroutine Name | OPT.NATURAL.NAT_NOM.SubroutineName | SubroutineName: Follow subroutines naming standard |
Info | Variable Name | OPT.NATURAL.NAT_NOM.VariableName | VariableName: Follow variables naming standard |
Info | Avoid Escape Top | OPT.NATURAL.NAT_PB.AvoidEscapeTop | AvoidEscapeTop: Do not use ESCAPE TOP statement |
Info | Avoid Debugging Write In Online Progs | OPT.NATURAL.NAT_MAN.AvoidDebuggingWriteInOnlineProgs | AvoidDebuggingWriteInOnlineProgs: Avoid debugging WRITE in online-processing programs. |
Low | Avoid Excessive Record Nesting | OPT.NATURAL.NAT_MAN.AvoidExcessiveRecordNesting | AvoidExcessiveRecordNesting: Avoid variable declarations (records) too deeply nested |
Low | Number Of Options In Decide | OPT.NATURAL.NAT_MAN.NumberOfOptionsInDecide | NumberOfOptionsInDecide: Try to limit the number of options in DECIDE statements |
Low | Avoid Find Read With Hold | OPT.NATURAL.NAT_PF.AvoidFindReadWithHold | AvoidFindReadWithHold: Detects READ/FIND sentences with UPDATE/STORE/DELETE instructions in its body |
Low | Avoid Where In Read And Find Statement | OPT.NATURAL.NAT_PF.AvoidWhereInReadAndFindStatement | AvoidWhereInReadAndFindStatement: Avoid WHERE clause in READ and FIND |
Medium | Avoid Deep Nesting Branches | OPT.NATURAL.NAT_MAN.AvoidDeepNestingBranches | AvoidDeepNestingBranches: Avoid deep nesting in flow control sentences (IF, FOR, REPEAT, DECIDE FOR, DECIDE ON) |
Medium | Avoid Accept Reject If | OPT.NATURAL.NAT_PB.AvoidAcceptRejectIf | AvoidAcceptRejectIf: Do not use ACCEPT/REJECT IF statement |
Medium | Avoid Recursive Calls | OPT.NATURAL.NAT_PB.AvoidRecursiveCalls | AvoidRecursiveCalls: Avoid recursive calls (PERFORM to the same subroutine , CALLNAT ... RUN to the same program/subprogram) |
Medium | Avoid Stop Statement | OPT.NATURAL.NAT_PB.AvoidStopStatement | AvoidStopStatement: Avoid STOP statement and use TERMINATE with the corresponding error code instead |
Medium | Avoid Terminate Without Error Code | OPT.NATURAL.NAT_PB.AvoidTerminateWithoutErrorCode | AvoidTerminateWithoutErrorCode: It's advisable to code TERMINATE with its corresponding error code |
Medium | End Transactions In Program Body | OPT.NATURAL.NAT_PB.EndTransactionsInProgramBody | EndTransactionsInProgramBody: Avoid placing BACKOUT or END TRANSACTION out of the programme body |
Medium | Only One Exit Point | OPT.NATURAL.NAT_PB.OnlyOneExitPoint | OnlyOneExitPoint: Code only one exit point to avoid possible errors |
Medium | Avoid Move By Name | OPT.NATURAL.NAT_PF.AvoidMoveByName | AvoidMoveByName: It is better to move based on the structure of the group or redefined variable |
Medium | Avoid Sort | OPT.NATURAL.NAT_PF.AvoidSort | AvoidSort: Do not use SORT statement |