I have written a COBOL program which has three cursors.Requirement was to read data from one SQL(cursor1) and based on values retrieved from cursor1 read cursor2,cursor3 and the write data to output file after performing some Computations.
I have written logic to read first cursor1 and based on retrieved values read cursor2,perform computation, write output file for cursor 2 till end of cursor2. And then for same values of cursor1 read cursor3 till end and write simultaneously.
My program is working perfectly fine and i an getting expected output.
But in my shop before code moved to production it has to pass SONAR.
And this sonar report is saying this program this has complexity much higher that authorized.
I believe i am getting this complexity message because of loops involved in program.
It will be a great help if you can suggest me better ways to write this program and remove this high complexity problem.
We use SONAR too.
When you search you program , it gives you blockers, critical messages and the corresponding impacted code.
So get the link of Sonar and search your module and see the error and fix it if you can't then explain it to responsible people why you can't do.