Quantcast

Cobol rule "Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Cobol rule "Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

jpfayolle

Hi,

 

Still working on Cobol code analysis and Sonar Cobol rules, I have a doubt about this one:

"Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

 

The justification for this rule in the ‘Sonar Way’ Quality Profile is this one : “PERFORM THRU should be used instead.”

 

I can understand the rule for a Section (a set of paragraphs).

For instance, section X has 3 paragraphs A, B, C. A “PERFORM X” will  execute sequentially paragraph A, then B, then C.

So, if someone adds a paragraph D into this section, this last one will be now executed with some undesirable consequences.

Thus, a “PERFORM A THRU C” should be used to avoid this risk.

 

But I don’t understand the justification for a unique paragraph. It is not possible to replace a PERFORM A with a Perform Thru.

I verified in the Sonar Custmnt2.cbl file that the rule is applied to a single paragraph.

 

I know the rule is deactivated by default but should this rule apply only to Section or also to Paragraphs?

 

Do not hesitate to ask for any precisions.

Regards.

Jean-Pierre

 

Jean-Pierre FAYOLLE

www.qualilogy.com

 

 

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cobol rule "Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

David Racodon-2
Hi Jean-Pierre,

First of all, thanks for your feedback.

I have to admit that I am not a Cobol expert.
But I found this explanation: http://www.tonymarston.net/cobol/cobolstandards.html#perform_section that sounds valid to me.
Do you agree?

It leads to another matter: our rule description should be more detailed.

Regards,

David RACODON | SonarSource
Senior Consultant



On 22 June 2012 16:20, Jean-Pierre Fayolle <[hidden email]> wrote:

Hi,

 

Still working on Cobol code analysis and Sonar Cobol rules, I have a doubt about this one:

"Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

 

The justification for this rule in the ‘Sonar Way’ Quality Profile is this one : “PERFORM THRU should be used instead.”

 

I can understand the rule for a Section (a set of paragraphs).

For instance, section X has 3 paragraphs A, B, C. A “PERFORM X” will  execute sequentially paragraph A, then B, then C.

So, if someone adds a paragraph D into this section, this last one will be now executed with some undesirable consequences.

Thus, a “PERFORM A THRU C” should be used to avoid this risk.

 

But I don’t understand the justification for a unique paragraph. It is not possible to replace a PERFORM A with a Perform Thru.

I verified in the Sonar Custmnt2.cbl file that the rule is applied to a single paragraph.

 

I know the rule is deactivated by default but should this rule apply only to Section or also to Paragraphs?

 

Do not hesitate to ask for any precisions.

Regards.

Jean-Pierre

 

Jean-Pierre FAYOLLE

www.qualilogy.com

 

 

 


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Cobol rule "Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

jpfayolle

Hi David,

 

The link you send is that the best practice is to use PERFORM SECTION and not PERFORM PARAGRAPH.

 

Now I understand that the rule implemented in the Sonar Cobol plugin is to never use Perform Section nor Perform Paragraph, but only Perform Thru

 

So my question was not so much about what is the best practice (you could find the exact contrary saying to never user Perform Thru) but how is it possible to use Perform Thru with an unique Paragraph?

 

In fact, I believe this rule means that you should never call a unique section or a unique paragraph but you should design your code in small paragraphs that should be called with a Perform Thru.

Well, this is the only way I could explain the rule.

 

Not really important, this rule is deactivated by default. Just trying to understand.

Regards,

Jean-Pierre

 

Jean-Pierre FAYOLLE

www.qualilogy.com

 

 

 

From: David Racodon [mailto:[hidden email]]
Sent: viernes, 22 de junio de 2012 17:51
To: [hidden email]
Subject: Re: [sonar-user] Cobol rule "Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

 

Hi Jean-Pierre,

 

First of all, thanks for your feedback.

 

I have to admit that I am not a Cobol expert.

But I found this explanation: http://www.tonymarston.net/cobol/cobolstandards.html#perform_section that sounds valid to me.

Do you agree?

 

It leads to another matter: our rule description should be more detailed.

 

Regards,

 

David RACODON | SonarSource
Senior Consultant



On 22 June 2012 16:20, Jean-Pierre Fayolle <[hidden email]> wrote:

Hi,

 

Still working on Cobol code analysis and Sonar Cobol rules, I have a doubt about this one:

"Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

 

The justification for this rule in the ‘Sonar Way’ Quality Profile is this one : “PERFORM THRU should be used instead.”

 

I can understand the rule for a Section (a set of paragraphs).

For instance, section X has 3 paragraphs A, B, C. A “PERFORM X” will  execute sequentially paragraph A, then B, then C.

So, if someone adds a paragraph D into this section, this last one will be now executed with some undesirable consequences.

Thus, a “PERFORM A THRU C” should be used to avoid this risk.

 

But I don’t understand the justification for a unique paragraph. It is not possible to replace a PERFORM A with a Perform Thru.

I verified in the Sonar Custmnt2.cbl file that the rule is applied to a single paragraph.

 

I know the rule is deactivated by default but should this rule apply only to Section or also to Paragraphs?

 

Do not hesitate to ask for any precisions.

Regards.

Jean-Pierre

 

Jean-Pierre FAYOLLE

www.qualilogy.com

 

 

 

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cobol rule "Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

Freddy Mallet
In reply to this post by David Racodon-2
Hi Jean-Pierre and David,

In fact the description is both too short and error-prone. Moreover this rule should be split in two rules (http://jira.sonarsource.com/browse/COBOL-650). 

Indeed, here we're are not talking about a quality flaw or about a "standard" best practice but as Cobol provides several way to do the same thing, it's very usual in each company to find a "local" best practice which can be either to :
  • Use section
  • Ban use of section
  • Always do a perform between two paragraphs which could be for instance MY-PARA and END-MY-PARA (sustained by a naming convention)
  • Always do a perform on one and only one paragraph
  • ...
So this Cobol rule provided by the SonarSource Cobol program just allows to check the compliance level to such kind of "local" best practices.

Do you share the same feeling ?

Kind regards,
Freddy
 
-----
Sonar for Continuous Inspection



On Sat, Jun 23, 2012 at 2:12 PM, Jean-Pierre Fayolle <[hidden email]> wrote:

Hi David,

 

The link you send is that the best practice is to use PERFORM SECTION and not PERFORM PARAGRAPH.

 

Now I understand that the rule implemented in the Sonar Cobol plugin is to never use Perform Section nor Perform Paragraph, but only Perform Thru

 

So my question was not so much about what is the best practice (you could find the exact contrary saying to never user Perform Thru) but how is it possible to use Perform Thru with an unique Paragraph?

 

In fact, I believe this rule means that you should never call a unique section or a unique paragraph but you should design your code in small paragraphs that should be called with a Perform Thru.

Well, this is the only way I could explain the rule.

 

Not really important, this rule is deactivated by default. Just trying to understand.

Regards,

Jean-Pierre

 

Jean-Pierre FAYOLLE

www.qualilogy.com

 

 

 

From: David Racodon [mailto:[hidden email]]
Sent: viernes, 22 de junio de 2012 17:51
To: [hidden email]
Subject: Re: [sonar-user] Cobol rule "Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

 

Hi Jean-Pierre,

 

First of all, thanks for your feedback.

 

I have to admit that I am not a Cobol expert.

But I found this explanation: http://www.tonymarston.net/cobol/cobolstandards.html#perform_section that sounds valid to me.

Do you agree?

 

It leads to another matter: our rule description should be more detailed.

 

Regards,

 

David RACODON | SonarSource
Senior Consultant



On 22 June 2012 16:20, Jean-Pierre Fayolle <[hidden email]> wrote:

Hi,

 

Still working on Cobol code analysis and Sonar Cobol rules, I have a doubt about this one:

"Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

 

The justification for this rule in the ‘Sonar Way’ Quality Profile is this one : “PERFORM THRU should be used instead.”

 

I can understand the rule for a Section (a set of paragraphs).

For instance, section X has 3 paragraphs A, B, C. A “PERFORM X” will  execute sequentially paragraph A, then B, then C.

So, if someone adds a paragraph D into this section, this last one will be now executed with some undesirable consequences.

Thus, a “PERFORM A THRU C” should be used to avoid this risk.

 

But I don’t understand the justification for a unique paragraph. It is not possible to replace a PERFORM A with a Perform Thru.

I verified in the Sonar Custmnt2.cbl file that the rule is applied to a single paragraph.

 

I know the rule is deactivated by default but should this rule apply only to Section or also to Paragraphs?

 

Do not hesitate to ask for any precisions.

Regards.

Jean-Pierre

 

Jean-Pierre FAYOLLE

www.qualilogy.com

 

 

 

 


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Cobol rule "Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

jpfayolle

Yes I do agree.

Thanks Freddy

Jean-Pierre

 

Jean-Pierre FAYOLLE

www.qualilogy.com

 

 

 

From: Freddy Mallet [mailto:[hidden email]]
Sent: domingo, 24 de junio de 2012 19:56
To: [hidden email]
Subject: Re: [sonar-user] Cobol rule "Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

 

Hi Jean-Pierre and David,

 

In fact the description is both too short and error-prone. Moreover this rule should be split in two rules (http://jira.sonarsource.com/browse/COBOL-650). 

 

Indeed, here we're are not talking about a quality flaw or about a "standard" best practice but as Cobol provides several way to do the same thing, it's very usual in each company to find a "local" best practice which can be either to :

  • Use section
  • Ban use of section
  • Always do a perform between two paragraphs which could be for instance MY-PARA and END-MY-PARA (sustained by a naming convention)
  • Always do a perform on one and only one paragraph
  • ...

So this Cobol rule provided by the SonarSource Cobol program just allows to check the compliance level to such kind of "local" best practices.

 

Do you share the same feeling ?

 

Kind regards,

Freddy

 

-----

Sonar for Continuous Inspection



On Sat, Jun 23, 2012 at 2:12 PM, Jean-Pierre Fayolle <[hidden email]> wrote:

Hi David,

 

The link you send is that the best practice is to use PERFORM SECTION and not PERFORM PARAGRAPH.

 

Now I understand that the rule implemented in the Sonar Cobol plugin is to never use Perform Section nor Perform Paragraph, but only Perform Thru

 

So my question was not so much about what is the best practice (you could find the exact contrary saying to never user Perform Thru) but how is it possible to use Perform Thru with an unique Paragraph?

 

In fact, I believe this rule means that you should never call a unique section or a unique paragraph but you should design your code in small paragraphs that should be called with a Perform Thru.

Well, this is the only way I could explain the rule.

 

Not really important, this rule is deactivated by default. Just trying to understand.

Regards,

Jean-Pierre

 

Jean-Pierre FAYOLLE

www.qualilogy.com

 

 

 

From: David Racodon [mailto:[hidden email]]
Sent: viernes, 22 de junio de 2012 17:51
To: [hidden email]
Subject: Re: [sonar-user] Cobol rule "Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

 

Hi Jean-Pierre,

 

First of all, thanks for your feedback.

 

I have to admit that I am not a Cobol expert.

But I found this explanation: http://www.tonymarston.net/cobol/cobolstandards.html#perform_section that sounds valid to me.

Do you agree?

 

It leads to another matter: our rule description should be more detailed.

 

Regards,

 

David RACODON | SonarSource
Senior Consultant

 

On 22 June 2012 16:20, Jean-Pierre Fayolle <[hidden email]> wrote:

Hi,

 

Still working on Cobol code analysis and Sonar Cobol rules, I have a doubt about this one:

"Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

 

The justification for this rule in the ‘Sonar Way’ Quality Profile is this one : “PERFORM THRU should be used instead.”

 

I can understand the rule for a Section (a set of paragraphs).

For instance, section X has 3 paragraphs A, B, C. A “PERFORM X” will  execute sequentially paragraph A, then B, then C.

So, if someone adds a paragraph D into this section, this last one will be now executed with some undesirable consequences.

Thus, a “PERFORM A THRU C” should be used to avoid this risk.

 

But I don’t understand the justification for a unique paragraph. It is not possible to replace a PERFORM A with a Perform Thru.

I verified in the Sonar Custmnt2.cbl file that the rule is applied to a single paragraph.

 

I know the rule is deactivated by default but should this rule apply only to Section or also to Paragraphs?

 

Do not hesitate to ask for any precisions.

Regards.

Jean-Pierre

 

Jean-Pierre FAYOLLE

www.qualilogy.com

 

 

 

 

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cobol rule "Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

David Racodon-2
In reply to this post by Freddy Mallet
Hi,

@Jean-Pierre: I got your point.
@Freddy: I do agree with you.

Regards,

David RACODON | SonarSource
Senior Consultant



On 25 June 2012 08:49, Jean-Pierre Fayolle <[hidden email]> wrote:

Yes I do agree.

Thanks Freddy

Jean-Pierre

 

Jean-Pierre FAYOLLE

www.qualilogy.com

 

 

 

From: Freddy Mallet [mailto:[hidden email]]
Sent: domingo, 24 de junio de 2012 19:56
To: [hidden email]
Subject: Re: [sonar-user] Cobol rule "Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

 

Hi Jean-Pierre and David,

 

In fact the description is both too short and error-prone. Moreover this rule should be split in two rules (http://jira.sonarsource.com/browse/COBOL-650). 

 

Indeed, here we're are not talking about a quality flaw or about a "standard" best practice but as Cobol provides several way to do the same thing, it's very usual in each company to find a "local" best practice which can be either to :

  • Use section
  • Ban use of section
  • Always do a perform between two paragraphs which could be for instance MY-PARA and END-MY-PARA (sustained by a naming convention)
  • Always do a perform on one and only one paragraph
  • ...

So this Cobol rule provided by the SonarSource Cobol program just allows to check the compliance level to such kind of "local" best practices.

 

Do you share the same feeling ?

 

Kind regards,

Freddy

 

-----

Sonar for Continuous Inspection



On Sat, Jun 23, 2012 at 2:12 PM, Jean-Pierre Fayolle <[hidden email]> wrote:

Hi David,

 

The link you send is that the best practice is to use PERFORM SECTION and not PERFORM PARAGRAPH.

 

Now I understand that the rule implemented in the Sonar Cobol plugin is to never use Perform Section nor Perform Paragraph, but only Perform Thru

 

So my question was not so much about what is the best practice (you could find the exact contrary saying to never user Perform Thru) but how is it possible to use Perform Thru with an unique Paragraph?

 

In fact, I believe this rule means that you should never call a unique section or a unique paragraph but you should design your code in small paragraphs that should be called with a Perform Thru.

Well, this is the only way I could explain the rule.

 

Not really important, this rule is deactivated by default. Just trying to understand.

Regards,

Jean-Pierre

 

Jean-Pierre FAYOLLE

www.qualilogy.com

 

 

 

From: David Racodon [mailto:[hidden email]]
Sent: viernes, 22 de junio de 2012 17:51
To: [hidden email]
Subject: Re: [sonar-user] Cobol rule "Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

 

Hi Jean-Pierre,

 

First of all, thanks for your feedback.

 

I have to admit that I am not a Cobol expert.

But I found this explanation: http://www.tonymarston.net/cobol/cobolstandards.html#perform_section that sounds valid to me.

Do you agree?

 

It leads to another matter: our rule description should be more detailed.

 

Regards,

 

David RACODON | SonarSource
Senior Consultant

 

On 22 June 2012 16:20, Jean-Pierre Fayolle <[hidden email]> wrote:

Hi,

 

Still working on Cobol code analysis and Sonar Cobol rules, I have a doubt about this one:

"Avoid using PERFORM PARAGRAPH or PERFORM SECTION"

 

The justification for this rule in the ‘Sonar Way’ Quality Profile is this one : “PERFORM THRU should be used instead.”

 

I can understand the rule for a Section (a set of paragraphs).

For instance, section X has 3 paragraphs A, B, C. A “PERFORM X” will  execute sequentially paragraph A, then B, then C.

So, if someone adds a paragraph D into this section, this last one will be now executed with some undesirable consequences.

Thus, a “PERFORM A THRU C” should be used to avoid this risk.

 

But I don’t understand the justification for a unique paragraph. It is not possible to replace a PERFORM A with a Perform Thru.

I verified in the Sonar Custmnt2.cbl file that the rule is applied to a single paragraph.

 

I know the rule is deactivated by default but should this rule apply only to Section or also to Paragraphs?

 

Do not hesitate to ask for any precisions.

Regards.

Jean-Pierre

 

Jean-Pierre FAYOLLE

www.qualilogy.com

 

 

 

 

 


Loading...