[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 567
  • Last Modified:

What is mean by (Baseline) JAVA0049 Nested block at depth '6' (maximum: '5')

What is mean by (Baseline) JAVA0049 Nested block at depth '6' (maximum: '5') ?

How to resolve this  ?
0
Sathish David  Kumar N
Asked:
Sathish David  Kumar N
  • 4
  • 2
2 Solutions
 
objectsCommented:
Nested Block Depth
It refers to the maximum nesting of blocks found in a method. Deeply nested blocks may make the code difficult to understand. Deeply nested blocks may be avoided by moving the code to separate method.

http://www.appperfect.com/support/docs/java-code-test/codetest/analyzing_results.html

Means your code has too many leveles of nesting

eg.

for (int i=0; i<5; i++) {    // 1 level
   if (c==x) {    // 2levels
      ....
0
 
Sathish David Kumar NAuthor Commented:
how to avoid in depth code?

if i write seprated function then it will coming under exit right?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
objectsCommented:
you break it into separate methods
0
 
Sathish David Kumar NAuthor Commented:
OK i will write 2 methos .
but while calling a method that will causing exit (my other question u answer like that ) right ?
0
 
objectsCommented:
you can't avoid exits, you just have to manage the number of them.
Its all about making your code more readable and maintainable
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now