title: Is it an abnormal to write function with multiple loop and if else statements in java
body: <p>I am writing java function with such a format : 
  I did not finish the function but I think the function has abnormal state, that means it is very difficult for another person to understand this code , am I  right?</p>
  
  <pre><code>public static int[] BankAndOrderIndex(int currentBank,int[] banksCoverMoneys,Table&lt;Integer, Integer, List&gt; paymentAmounts,Table&lt;Integer, Integer, List&gt; booleanTable){
  
      int[] bank_order_pair=new int[2];//index 0 -&gt; bank number | index 1 -&gt; index number of order of list in amounts table 
      int counter=0;
      int[] OtherLargestPayment=new int[2];//index 0 -&gt; bank number | index 1 -&gt; index number of order of list in amounts table
      int second_counter=0;
      for(int i=0; i&lt;banksCoverMoneys.length; i++){
          if(i!=currentBank){
              for(int x=0; x&lt;booleanTable.get(i, currentBank).size(); x++){
                  if((int)booleanTable.get(i,currentBank).get(x)==0){//if there is an inactive payment order
                      if(banksCoverMoneys[i]-(int)paymentAmounts.get(i,currentBank).get(x)&gt;=0){//if it does not create or enlarge a deficit for its sender
                          if((int)paymentAmounts.get(i,currentBank).get(x)&gt;=Math.abs(banksCoverMoneys[currentBank])){//order whose amount is larger than the current deficit
                              boolean such_payment_order=true;
                              if(counter==0){
                                  bank_order_pair[0]=i; bank_order_pair[1]=x;
                                  counter++;
                              }
                              else if(counter==1){//to control there is smaller such payment order
                                  if((int)paymentAmounts.get(i,currentBank).get(x) &lt; 
                                          (int)paymentAmounts.get(bank_order_pair[0],currentBank).get(bank_order_pair[1])){
                                      bank_order_pair[0]=i; bank_order_pair[1]=x; //gives bank and list index for smallest such payment order
                                  }
                              }
  
                          }
                          else{
                              boolean such_payment_order=false;
                              if(second_counter==0){
                                  OtherLargestPayment[0]=i; OtherLargestPayment[1]=x;
                                  second_counter++;
                              }
                              else if(second_counter==1){//to find largest such payment order
                                  if(){
  
                                  }
                              }
  
                          }
                      }
                  }
              }
          }
  
      }
  
  
  }
  </code></pre>