title: Are there any way reduced 'The Cyclomatic Complexity' of follwing java code.?
body: <p>I am want to know following two code complexity can be reduced further. They are given complexity issues in my sonar server. need some experts help to resolve this issues without damage existing logic. I am using java 8 , it also fine are their any easy way in java 8 too.</p>
  
  <p>Code 1 :</p>
  
  <pre class="lang-java prettyprint-override"><code>private DateTime GDT(final P1 prescriptionStartTimeHelper, P2doseDetailModel, P3 prescriptionModelSpi,
      final P4 prescriptionFacade) {
      final DepositModelSpi depositModel = //
      final DateTime userSetDateValue = //
          DateTime depositTime = //
  
      if ((userSetDateValue != null) &amp;&amp; (DepositType.DATE == depositModel.getDepositTypeConstraint().getValue())) {
          final DosageMixedType doseType = //
          final LocalTime userSetLocalTime = //
  
          switch (doseType) {
              case A:
  
                  // find the unit time list
                  final List&lt;LocalTime&gt; unitTimeList = //
  
                  if (!unitTimeList.contains(userSetLocalTime)) {
                      final LocalTime firstOccasionTime = unitTimeList.get(0);
                      depositTime =//
  
                  } else {
                      depositTime = //
                  }
  
                  break;
              case B:
  
                  final LocalTime doseTime = //;
                      depositTime = //
  
                  break;
              case C:
              case D:
              case E:
              case F:
              case G:
                  depositTime = //;
                  break;
              default:
                  depositTime = //
  
          }
      }
  
      return depositTime;
  }
  </code></pre>