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:
		
				
					committed by
					
						
						Ilkka Seppälä
					
				
			
			
				
	
			
			
			
						parent
						
							c6ecf58687
						
					
				
				
					commit
					f7e22a1cf6
				
			@@ -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);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user