Source:
<code><START> public AccessResultCode execute(final LnClientConnection conn, final DlmsDevice device, <END> final PushSetupAlarm pushSetupAlarm) throws ProtocolAdapterException { final SetParameter setParameterSendDestinationAndMethod; if (pushSetupAlarm.hasPushObjectList()) { LOGGER.warn("Setting Push Object List of Push Setup Alarm not implemented: " + pushSetupAlarm.getPushObjectList()); } if (pushSetupAlarm.hasSendDestinationAndMethod()) { final AttributeAddress sendDestinationAndMethodAddress = new AttributeAddress(CLASS_ID, OBIS_CODE, ATTRIBUTE_ID_SEND_DESTINATION_AND_METHOD); final DataObject value = this.buildSendDestinationAndMethodObject(pushSetupAlarm .getSendDestinationAndMethod()); setParameterSendDestinationAndMethod = new SetParameter(sendDestinationAndMethodAddress, value); } else { LOGGER.error("Send Destination and Method of the Push Setup Alarm is expected to be set."); setParameterSendDestinationAndMethod = null; } if (pushSetupAlarm.hasCommunicationWindow()) { LOGGER.warn("Setting Communication Window of Push Setup Alarm not implemented: " + pushSetupAlarm.getCommunicationWindow()); } if (pushSetupAlarm.hasRandomisationStartInterval()) { LOGGER.warn("Setting Randomisation Start Interval of Push Setup Alarm not implemented: " + pushSetupAlarm.getRandomisationStartInterval()); } if (pushSetupAlarm.hasNumberOfRetries()) { LOGGER.warn("Setting Number of Retries of Push Setup Alarm not implemented: " + pushSetupAlarm.getNumberOfRetries()); } if (pushSetupAlarm.hasRepetitionDelay()) { LOGGER.warn("Setting Repetition Delay of Push Setup Alarm not implemented: " + pushSetupAlarm.getRepetitionDelay()); } if (setParameterSendDestinationAndMethod == null) { return AccessResultCode.OTHER_REASON; } try { return conn.set(setParameterSendDestinationAndMethod).get(0); } catch (final IOException e) { throw new ConnectionException(e); } }</code><technical_language>![MAJOR](<LINK_1> Cyclomatic Complexity of this method "execute" is 14 is greater 10 authorized. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public AccessResultCode execute(final LnClientConnection conn, final DlmsDevice device, final PushSetupAlarm pushSetupAlarm) throws ProtocolAdapterException { final SetParameter setParameterSendDestinationAndMethod; if (pushSetupAlarm.hasPushObjectList()) { LOGGER.warn("Setting Push Object List of Push Setup Alarm not implemented: {}", pushSetupAlarm.getPushObjectList()); } if (pushSetupAlarm.hasSendDestinationAndMethod()) { final AttributeAddress sendDestinationAndMethodAddress = new AttributeAddress(CLASS_ID, OBIS_CODE, ATTRIBUTE_ID_SEND_DESTINATION_AND_METHOD); final DataObject value = this.buildSendDestinationAndMethodObject(pushSetupAlarm .getSendDestinationAndMethod()); setParameterSendDestinationAndMethod = new SetParameter(sendDestinationAndMethodAddress, value); } else { LOGGER.error("Send Destination and Method of the Push Setup Alarm is expected to be set."); throw new ProtocolAdapterException("Error setting Alarm push setup data. No destination and method data"); } if (pushSetupAlarm.hasCommunicationWindow()) { LOGGER.warn("Setting Communication Window of Push Setup Alarm not implemented: {}", pushSetupAlarm.getCommunicationWindow()); } if (pushSetupAlarm.hasRandomisationStartInterval()) { LOGGER.warn("Setting Randomisation Start Interval of Push Setup Alarm not implemented: {}", pushSetupAlarm.getRandomisationStartInterval()); } if (pushSetupAlarm.hasNumberOfRetries()) { LOGGER.warn("Setting Number of Retries of Push Setup Alarm not implemented: {}", pushSetupAlarm.getNumberOfRetries()); } if (pushSetupAlarm.hasRepetitionDelay()) { LOGGER.warn("Setting Repetition Delay of Push Setup Alarm not implemented: {}", pushSetupAlarm.getRepetitionDelay()); } List<AccessResultCode> resultCodes; try { resultCodes = conn.set(setParameterSendDestinationAndMethod); } catch (final IOException e) { throw new ConnectionException(e); } if (resultCodes != null && !resultCodes.isEmpty()) { return resultCodes.get(0); } else { throw new ProtocolAdapterException("Error setting Alarm push setup data."); } }