我们的团队正在为各种语言(java,pl / sql,C,C ++)运行SonarQube实例。
最近我们被要求对COBOL代码运行代码质量分析。
我们从开发团队收到了一些COBOL代码并运行了Jenkins的工作。
在分析过程中,我们会看到一些解析错误。
接下来根据分析没有发现任何问题。
这是我们第一次在分析中没有遇到任何问题,所以我们有些可疑并想知道COBOL代码是否实际上是以正确的方式解析的。
仅供参考我们自己没有任何COBOL背景。
我已经粘贴了分析过程中显示的一些错误。
最后分析报告: 09:01:51.131 INFO - 分析了2/2个文件,但由于我们不是COBOL专家,我们想知道代码是否经过实际分析?
详细信息:
我们向开发团队提出的问题:
解析错误 *预处理内容:
Parse error at line 279:
279: 01 MISCELLANEOUS-LITERALS .
^
283: 05 L-ERROR-SIZE-ERROR PIC S9 ( 4 ) COMP VALUE 1 .
284: 05 L-ERROR-CONTRACT-ORDER PIC S9 ( 4 ) COMP VALUE 2 .
285: 05 L-ERROR-ORDER-SUBS-TRAFFIC PIC S9 (*
*预处理内容:
Parse error at line 55:
55: 01 LITERALS .
^
56: 02 L-NO-CONTEXT-FOUND PIC 9 ( 4 ) COMP VALUE 5 .
57: 02 L-ERROR-REQUEST-CODE PIC 9 ( 4 ) COMP VALUE 14 .
58: 02 L-ERROR-READ-FIRST PIC 9 (
09:01:51.124 ERROR - Unable to parse COBOL source file : /home/ecbbuild/cobol/dvs010.tdsrcdgs.gsu2001l at line 279
Original contents starting from line 259 till line 299:
* 48 : dependent end-pay
*
* When items is produced by ENDPAY request,
* 50 is added to the values above
*
* Encoding of internal-sort, when usage-plan discounts:
*
* 99PPPPPPPPQQQQQQFF
* PPPPPPPP Usage-plan-product-nr from line-total-adjust
* QQQQQQ First-start-date converted to georgian date,
* FF Usage-plan-display-aggregate-flag N=1, Y=2, D=3
*
* Encoding of internal-sort, when information-item-type:
*
* 00PPPPPPPPYYYYMMDD
* PPPPPPPP product-reference-code OF inv-item-table
* YYYYMMDD item-from-date OF inv-item-table
*
?SECTION gsu2001-error-literals
01 miscellaneous-literals.
*
* Reply-codes:
*
05 l-error-size-error pic S9(4) comp value 1.
05 l-error-contract-order pic S9(4) comp value 2.
05 l-error-order-subs-traffic pic S9(4) comp value 3.
05 l-error-date-interval pic S9(4) comp value 4.
05 l-error-inv-item pic S9(4) comp value 5.
05 l-error-update-sold-product pic S9(4) comp value 6.
05 l-error-inv-item-text pic S9(4) comp value 7.
05 l-error-delete-sold-item-text pic S9(4) comp value 9.
05 l-error-sold-item-text pic S9(4) comp value 14.
*-FAD-MOD-15.04.2005-#446902--------------------------------------------------*
* 05 l-error-line-total pic S9(4) comp value 15.
* 05 l-error-line-total-adjust pic S9(4) comp value 17.
05 l-error-contract pic S9(4) comp value 30.
05 l-original-invoice-not-found pic s9(4) comp value 38.
* 05 l-dup-error pic s9(4) comp value 39.
* 05 l-error-reading-cost-detail pic s9(4) comp value 40.
***FIX IT - START*
答案 0 :(得分:1)
从我的角度来看,这是一个疯狂的猜测:确保您处理代码,因为包括领先的空白。 COBOL不是自由格式的(在COBOL 2002之前不是这样),所以位置很重要 - 标记注释的星号必须在第7列等。