rspec/rules/S3606/cobol/rule.adoc

45 lines
1.3 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
Program/file names offer only very limited space for indicating program function, which is why you should take advantage of the ability to specify a program ``++TITLE++``. Omitting the ``++TITLE++`` statement will result in a default, uncommunicative ``++TITLE++`` value being printed at the top of each page of the source listing. Instead, you should write an expressive title that gives a clear impression of the program's function.
This rule raises an issue when a there is no ``++TITLE++`` before the ``++IDENTIFICATION DIVISION++``. Ideally, ``++TITLE++`` will be the first line of a program, but it cannot be placed before compiler options.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,cobol]
2021-04-28 16:49:39 +02:00
----
* Copyright (c) 2012 MyCo. All rights reserved. *> Noncompliant
IDENTIFICATION DIVISION.
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,cobol]
2021-04-28 16:49:39 +02:00
----
TITLE 'IntradayPosition.ExecutePostProcessing'
* Copyright (c) 2012 MyCo. All rights reserved.
IDENTIFICATION DIVISION.
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
* Add a title to this program.
* Move this title to the first line of the file.
=== Highlighting
``++TITLE++`` if it exists on the wrong line, otherwise file level issue
endif::env-github,rspecator-view[]