Professional Documents
Culture Documents
R19
JBC P r e c o m pil e r R ul e s
Amendment History:
Revisio
Date Amended Name Description
n
1 17th Dec 2018 Monisha A Initial version
Basheer
2 21st Mar 2019 R19 AMR review
Ahamed
Page 2
JBC P r e c o m pil e r R ul e s
C o p yri g h t
Err a t a a n d C o m m e n t s
If you have any comments regarding this manual or wish to report any errors in the
documentation, please document them and send them to the address below:
Technology Department
Temenos Headquarters SA
2 Rue de l’Ecole-de-Chimie,
CH - 1205 Geneva,
Switzerland
Please include your name, company, address, and telephone and fax numbers, and email
address if applicable. TAFJdev@temenos.com
Page 3
JBC P r e c o m pil e r R ul e s
Table of Contents
Copyright................................................................................................................................................ 3
Errata and Comments............................................................................................................................ 3
Introduction.......................................................................................................................... 6
JBC Precompiler Rules....................................................................................................... 6
Rule 1: !HUSHIT is not supported in TAFJ. Use HUSHIT............................................6
Rule 2: ABORT will result in abrupt abortion...............................................................7
Rule 3: Avoid CALLC command- Check if Integration Event (IF) can be used..........7
Rule 4: Avoid CHAIN as Process control will never return to the invoker.................8
Rule 5: Avoid Code after THEN/ELSE on Same line....................................................8
Rule 6: Avoid GOTO as readability of code is reduced...............................................9
Rule 7: CHAR should be replaced by CHARX............................................................10
Rule 8: Check if C$SESSION.NO can be used instead of TNO_Operator................10
Rule 9: Check if CACHE.DBR can be replaced by CACHE.READ............................11
Rule 10: Check if DBR can be replaced by Read of full record................................12
Rule 11: Check if sequential file can be changed to T24 data base file...................13
Rule 12: Condition lines '$1' ; exceeded allowed limit '$2'.......................................13
Rule 13: CRT is incompatible with Browser, Desktop and other GUI......................14
Rule 14: Do not do Input / Output operations in filter of a service/COB-
API/Command '$1'........................................................................................................15
Rule 15: Do not read Standard Selection directly to improve performance............18
Rule 16: Do not tamper/refer to Sensitive property / Method '$1'............................20
Rule 17: Do not use DCOUNT on FOR loop to improve performance.....................23
Rule 18: Do not use IDescriptor..................................................................................23
Rule 19: Ensure EB.ERROR with Pattern<Product-ErrorText> is used to set ETEXT
....................................................................................................................................... 24
Rule 20: Ensure OVERRIDE with Pattern <Product-OverrideText> is used to set
TEXT.............................................................................................................................. 24
Rule 21: INPUT is incompatible with Browser, Desktop and other GUI...................25
Rule 22: INPUT.BUFFER is incompatible with Browser, Desktop and other GUI....25
Rule 23: MATCHES does not work with Field and Sub-value Markers....................26
Rule 24: Maximum no of executable lines in code '$1' exceeded allowed limit '$2'
....................................................................................................................................... 27
Rule 25: Move to Load routine API/Command :'$1'...................................................28
Page 4
JBC P r e c o m pil e r R ul e s
Page 5
JBC P r e c o m pil e r R ul e s
Intro d u c ti o n
JBC Precompiler is a component that contains a set of rules used by JBC SonarQube plugin
to analyse the JBC code and provide the following metrics such as
- Code duplication.
This document contains the list of rules, examples of compliant code and tips for working
around the issue.
JBC P r e c o m p i l e r R u l e s
R u l e 1 : ! H U S H IT i s n o t s u p p o r t e d i n TAFJ. U s e H U S H I T
Noncompliant Code (as per T24 standards)
Page 6
JBC P r e c o m pil e r R ul e s
R u l e 2 : A B ORT w i l l r e s u l t i n a b r u p t a b o r t i o n
Noncompliant Code (as per T24 standards)
R u l e 3 : Avo i d CALLC c o m m a n d - C h e c k if I n t e g r a t i o n Ev e n t ( I F ) c a n
be used
Noncompliant Code (as per T24 standards)
Equivalent java function should be provided and it should be called directly instead of
CALLC.
Page 7
JBC P r e c o m pil e r R ul e s
R u l e 4 : Avo i d C HAI N a s P r o c e s s c o n t r o l w i l l n e v e r r e t u r n t o t h e
invok er
Noncompliant Code (as per T24 standards)
R u l e 5 : Avo i d C o d e a f t e r T H E N / EL S E o n S a m e l i n e
Noncompliant Code (as per T24 standards)
Code should be written in separate lines after THEN and ELSE statements.
Page 8
JBC P r e c o m pil e r R ul e s
R u l e 6 : Avo i d GOTO a s r e a d a b i l i ty o f c o d e i s r e d u c e d
Noncompliant Code (as per T24 standards)
Page 9
JBC P r e c o m pil e r R ul e s
R u l e 7 : C HAR s h o u l d b e r e p l a c e d b y C HARX
Noncompliant Code (as per T24 standards)
Page 10
JBC P r e c o m pil e r R ul e s
Page 11
JBC P r e c o m pil e r R ul e s
R u l e 1 0 : C h e c k if D B R c a n b e r e p l a c e d b y R e a d o f f u l l r e c o r d
Noncompliant Code (as per T24 standards)
Page 12
JBC P r e c o m pil e r R ul e s
R u l e 1 1 : C h e c k if s e q u e n t i a l fil e c a n b e c h a n g e d t o T 2 4 d a t a b a s e
fi l e
Noncompliant Code (as per T24 standards)
Use sequential file only when there is a necessity to process a file line by line.
Page 13
JBC P r e c o m pil e r R ul e s
R u l e 1 3 : CRT i s i n c o m p a t i b l e w i t h B r o w s er, D e s k t o p a n d o t h e r G UI
Noncompliant Code (as per T24 standards)
Use Logger if necessary to capture the output with Browser, Desktop and other GUI.
Page 14
JBC P r e c o m pil e r R ul e s
R u l e 1 4 : D o n o t d o I n p u t / O u t p u t o p e r a t i o n s i n fi l t e r o f a
s e r vi c e /CO B - API/C o m m a n d ' $ 1'
Noncompliant Code (as per T24 standards)
Page 15
JBC P r e c o m pil e r R ul e s
Page 16
JBC P r e c o m pil e r R ul e s
Page 17
JBC P r e c o m pil e r R ul e s
R u l e 1 5 : D o n o t r e a d S t a n d a r d S e l e c t i o n d i r e c t ly t o i m p r o v e
p erf or m a n c e
Noncompliant Code (as per T24 standards)
Page 18
JBC P r e c o m pil e r R ul e s
The following APIs can be used to get the details of Standard Selection instead of direct
read.
Page 19
JBC P r e c o m pil e r R ul e s
R u l e 1 6 : D o n o t t a m p e r /r e f e r t o S e n s i t iv e p r o p e r ty / M e t h o d ' $ 1'
Noncompliant Code (as per T24 standards)
Page 20
JBC P r e c o m pil e r R ul e s
Page 21
JBC P r e c o m pil e r R ul e s
Page 22
JBC P r e c o m pil e r R ul e s
R u l e 1 7 : D o n o t u s e D CO U N T o n FO R l o o p t o i m p r o v e p e r f o r m a n c e
Noncompliant Code (as per T24 standards)
Use a separate variable to get the value of DCOUNT and then use the same variable in FOR
loop.
Rul e 1 8: D o n o t u s e ID e s cript or
Noncompliant Code (as per T24 standards)
Page 23
JBC P r e c o m pil e r R ul e s
Handle the required functionality in enquiry level by attaching conversion routine to the field
in enquiry as IDESC is not supported in TAFJ.
Page 24
JBC P r e c o m pil e r R ul e s
R u l e 2 1 : I N P U T i s i n c o m p a t i b l e w i t h B r o w s er, D e s k t o p a n d o t h e r
GUI
Noncompliant Code (as per T24 standards)
Page 25
JBC P r e c o m pil e r R ul e s
R u l e 2 2 : I N P UT. B U F FE R i s i n c o m p a t i b l e w i t h B r o w s er, D e s k t o p
a n d o t h e r G UI
Noncompliant Code (as per T24 standards)
Page 26
JBC P r e c o m pil e r R ul e s
R u l e 2 4 : M a x i m u m n o o f e x e c u t a b l e li n e s i n c o d e ' $ 1' e x c e e d e d
a l l o w e d l i m i t ' $ 2'
Noncompliant Code (as per T24 standards)
Page 27
JBC P r e c o m pil e r R ul e s
The entire code can be analysed and split up into separate sub routines.
Page 28
JBC P r e c o m pil e r R ul e s
R u l e 2 6 : N o c a l l t o BATC H . B U ILD.LI S T m a d e
Noncompliant Code (as per T24 standards)
Page 29
JBC P r e c o m pil e r R ul e s
Page 30
JBC P r e c o m pil e r R ul e s
Page 31
JBC P r e c o m pil e r R ul e s
R u l e 2 9 : P R I N T i s i n c o m p a t i b l e w i t h B r o w s er, D e s k t o p a n d o t h e r
GUI
Noncompliant Code (as per T24 standards)
Page 32
JBC P r e c o m pil e r R ul e s
Page 33
JBC P r e c o m pil e r R ul e s
R u l e 3 1 : R e p l a c e CALL @ w i t h E B . S y s t e mT a b l e s .C a l lA PI
Noncompliant Code (as per T24 standards)
R u l e 3 2 : R e p l a c e E B . R EA DLI S T w i t h DA S
Noncompliant Code (as per T24 standards)
Page 34
JBC P r e c o m pil e r R ul e s
Page 35
JBC P r e c o m pil e r R ul e s
R u l e 3 4 : R e p l a c e TXT w i t h o v e rr i d e s
Noncompliant Code (as per T24 standards)
Specify the text that needs to be displayed in OVERRIDE table and mention the override id
in TEXT before calling STORE.OVERRIDE.
Page 36
JBC P r e c o m pil e r R ul e s
R u l e 3 5 : S E Q s h o u l d b e r e p l a c e d b y S E QX
Noncompliant Code (as per T24 standards)
Page 37
JBC P r e c o m pil e r R ul e s
Don’t use the below list of commands as they are not supported in TAFJ.
R u l e 3 7 : TXTI N P U T i s i n c o m p a t i b l e w i t h B r o w s er, D e s k t o p a n d
o t h e r G UI
Noncompliant Code (as per T24 standards)
Page 38
JBC P r e c o m pil e r R ul e s
R u l e 3 8 : U s a g e o f ' $ 1' c a n j e o p a r d i z e t r a n s a c t i o n m a n a g e m e n t
Noncompliant Code (as per T24 standards)
R u l e 3 9 : U s e E B . S M S . g e t R o l e /E B . S M S . g e t S M S P r o f i l e API
Noncompliant Code (as per T24 standards)
Page 39
JBC P r e c o m pil e r R ul e s
R u l e 4 0 : U s e AC.API.E b R e a d C o n t r a c t B a l a n c e s API if r e a d i n g EC B
f o r ACCO U N T Ap p l i c a t i o n
Noncompliant Code (as per T24 standards)
Page 40
JBC P r e c o m pil e r R ul e s
Page 41
JBC P r e c o m pil e r R ul e s
R u l e 4 2 : U s e A c c o u n t S e r vi c e API t o g e t b a l a n c e s
Noncompliant Code (as per T24 standards)
Page 42
JBC P r e c o m pil e r R ul e s
Page 43
JBC P r e c o m pil e r R ul e s
R u l e 4 3 : U s e C HA N GE t o i m p r o v e p e r f o r m a n c e if y o u u s e l a r g e
a rr ay s
Noncompliant Code (as per T24 standards)
R u l e 4 4 : U s e C u s t o m e r S e r vi c e API
Noncompliant Code (as per T24 standards)
Page 44
JBC P r e c o m pil e r R ul e s
R u l e 4 5 : U s e o f Of s G l o b u s M a n a g e r c a n r e s u l t i n c o r r u p t i o n o f
Tra n s a c t i o n B o u n d a r i e s
Noncompliant Code (as per T24 standards)
Page 45
JBC P r e c o m pil e r R ul e s
R u l e 4 6 : U s e ST.C u rr e n c yC o n f i g .G e t C c y H i s t o ry API
Noncompliant Code (as per T24 standards)
Use API to get the history file instead of direct read on history file.
R u l e 4 7 : U s e ST.C u rr e n c yC o n f i g .G e t C u rr e n c y R e c o r d API
Noncompliant Code (as per T24 standards)
Page 46
JBC P r e c o m pil e r R ul e s
Page 47