rspec/rules/S1192/cobol/rule.adoc

62 lines
1.1 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
2020-06-30 12:47:33 +02:00
include::../description.adoc[]
2023-10-11 11:41:24 +02:00
=== Exceptions
Literals with fewer than 7 characters are ignored.
Only duplications located in a `PROCEDURE DIVISION`, not those contained in copybooks are reported.
== How to fix it
include::../howtofix.adoc[]
=== Code examples
==== Noncompliant code example
2020-06-30 12:47:33 +02:00
With the default threshold of 3:
2023-10-11 11:41:24 +02:00
[source,cobol,diff-id=1,diff-type=noncompliant]
2020-06-30 12:47:33 +02:00
----
PROCEDURE DIVISION.
DISPLAY "Firstname: ".
*...
DISPLAY "Firstname: ".
*...
DISPLAY "Firstname: ".
----
2023-10-11 11:41:24 +02:00
==== Compliant solution
2020-06-30 12:47:33 +02:00
2023-10-11 11:41:24 +02:00
[source,cobol,diff-id=1,diff-type=compliant]
2020-06-30 12:47:33 +02:00
----
WORKING-STORAGE SECTION.
01 FIRST-NAME-HEADER PIC X(42) VALUE "Firstname: ".
PROCEDURE DIVISION.
DISPLAY FIRST-NAME-HEADER
*...
DISPLAY FIRST-NAME-HEADER
*...
DISPLAY FIRST-NAME-HEADER
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../parameters.adoc[]
include::../highlighting.adoc[]
'''
endif::env-github,rspecator-view[]