508 : Sonar qube critical Issue Fix (#854)

* 508 : Sonar qube critical Issue Fix
Refactor this method to reduce its Cognitive Complexity from 30 to the 15 allowed.

* 508: Sonar Qube Issue fxes
Define a constant instead of duplicating this literal " does not exist." 3 times.

* 508: sonar qube issue fixes
Define a constant instead of duplicating this literal "Some external api for only realtime execution could be called here." 3 times.
This commit is contained in:
kanwarpreet25
2019-07-28 18:12:03 +05:30
committed by Ilkka Seppälä
parent c6ecf58687
commit f7e22a1cf6
3 changed files with 72 additions and 55 deletions

View File

@ -44,6 +44,8 @@ public class Account {
private final int accountNo;
private final String owner;
private BigDecimal money;
private static final String MSG = "Some external api for only realtime execution could be called here.";
/**
* Instantiates a new Account.
@ -126,7 +128,7 @@ public class Account {
depositMoney(money);
AccountAggregate.putAccount(this);
if (realTime) {
LOGGER.info("Some external api for only realtime execution could be called here.");
LOGGER.info(MSG);
}
}
@ -138,7 +140,7 @@ public class Account {
withdrawMoney(money);
AccountAggregate.putAccount(this);
if (realTime) {
LOGGER.info("Some external api for only realtime execution could be called here.");
LOGGER.info(MSG);
}
}
@ -160,7 +162,7 @@ public class Account {
public void handleEvent(AccountCreateEvent accountCreateEvent) {
AccountAggregate.putAccount(this);
if (accountCreateEvent.isRealTime()) {
LOGGER.info("Some external api for only realtime execution could be called here.");
LOGGER.info(MSG);
}
}