我们的团队正在为各种语言(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*
发布于 2014-06-27 08:41:18
我只是胡思乱想:确保您按照提供的代码来处理代码,包括前面的空格。COBOL不是自由格式的(至少在COBOL 2002之前没有),所以位置很重要--标记注释的星号必须在第7栏等。
https://stackoverflow.com/questions/24446648
复制相似问题