Skip to content

Commit

Permalink
code smell
Browse files Browse the repository at this point in the history
  • Loading branch information
ndduc01 committed Feb 3, 2025
1 parent 6d18eba commit 646e9eb
Show file tree
Hide file tree
Showing 19 changed files with 172 additions and 274 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//
//import java.util.*;
//
///**
// 125 - Comment complaint
// 3776 - Complex complaint
// 6204 - Forcing convert to stream to list complaint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public AuthUserProfileInfo getAuthUserInfo(String authUserId) throws DataProcess
else {
throw new DataProcessingException("Auth User Not Found");
}
AuthUserProfile.authUserProfileInfo = authUserData;
AuthUserProfile.authUserProfileInfo = authUserData; //NOSONAR
}

return AuthUserProfile.authUserProfileInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ else if (object instanceof Collection<?>)
return isAdvancedInvCriteriaMet;
}

private void processAction(EdxLabInformationDto edxRuleAlgorothmManagerDT, Algorithm algorithm) throws DataProcessingException {
private void processAction(EdxLabInformationDto edxRuleAlgorothmManagerDT, Algorithm algorithm) {
//applicationMap
Map<Object, Object> applicationMap= new HashMap<>();
ActionType actionType = algorithm.getAction();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ private TreeMap<Object,Object> createDMBQuestionMap(Collection<MetaAndWaCommonAt
}


protected Collection<LookupMappingDto> getPrePopMapping() throws DataProcessingException {
protected Collection<LookupMappingDto> getPrePopMapping() {
return retrievePrePopMapping();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public String deriveJurisdictionCd(BaseContainer proxyVO, ObservationDto rootObs
private HashMap<String, String> resolveLabReportJurisdiction(PersonContainer patientContainer,
PersonContainer providerContainer,
OrganizationContainer organizationContainer,
OrganizationContainer organizationContainer2) throws DataProcessingException {
OrganizationContainer organizationContainer2) {
Collection<String> patientJurisdictionCollection;
Collection<String> providerJurisdictionCollection;
Collection<String> organizationJurisdictionCollection = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ else if (obsDomainCdSt1 != null && obsDomainCdSt1.equalsIgnoreCase(EdxELRConstan
}


@SuppressWarnings("java:S3776")
@SuppressWarnings({"java:S3776","java:S4144"})
protected void progAndJurisdictionAggregationHelper(LabResultProxyContainer labResult,
EdxLabInformationDto edxLabInformationDto,
PersonAggContainer personAggContainer,
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ private void persistingManufacturedMaterial(Long uid, Collection<ManufacturedMat
}

}
private void persistingEntityId(Long uid, Collection<EntityIdDto> entityIdCollection ) throws DataProcessingException {
private void persistingEntityId(Long uid, Collection<EntityIdDto> entityIdCollection ) {
Iterator<EntityIdDto> anIterator;
ArrayList<EntityIdDto> entityList = (ArrayList<EntityIdDto> )entityIdCollection;
anIterator = entityList.iterator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private String getLocalId(OrganizationContainer organizationContainer) {
@SuppressWarnings("java:S3776")

// getting identifiers for PHCR Organizations
private List<String> getIdentifier(OrganizationContainer organizationContainer) throws DataProcessingException {
private List<String> getIdentifier(OrganizationContainer organizationContainer) {
String carrot = "^";
List<String> identifierList = new ArrayList<>();
String identifier = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ public void saveParticipation(ParticipationDto participationDto) throws DataProc
deleteParticipationByPk(participationDto.getSubjectEntityUid(), participationDto.getActUid(), participationDto.getActClassCd());
}
}
private void persistingParticipation(ParticipationDto participationDto) throws DataProcessingException {
private void persistingParticipation(ParticipationDto participationDto) {
if (participationDto.getSubjectEntityUid() != null && participationDto.getActUid() != null) {
var data = new Participation(participationDto);
participationRepository.save(data);
}
}

private void deleteParticipationByPk(Long subjectId, Long actId, String classCode) throws DataProcessingException {
private void deleteParticipationByPk(Long subjectId, Long actId, String classCode) {
dataModifierReposJdbc.deleteParticipationByPk(subjectId, actId, classCode);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
@SuppressWarnings({"java:S125", "java:S3776", "java:S6204", "java:S1141", "java:S1118", "java:S1186", "java:S6809", "java:S6541", "java:S2139", "java:S3740",
"java:S1149", "java:S112", "java:S107", "java:S1195", "java:S1135", "java:S6201", "java:S1192", "java:S135", "java:S117"})
public class NokMatchingService extends NokMatchingBaseService implements INokMatchingService {
private static final Logger logger = LoggerFactory.getLogger(NokMatchingService.class);
private static final Logger logger = LoggerFactory.getLogger(NokMatchingService.class); // NOSONAR

public NokMatchingService(
EdxPatientMatchRepositoryUtil edxPatientMatchRepositoryUtil,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

@Service
public class PatientMatchingService extends PatientMatchingBaseService implements IPatientMatchingService {
private static final Logger logger = LoggerFactory.getLogger(PatientMatchingService.class);
private static final Logger logger = LoggerFactory.getLogger(PatientMatchingService.class); // NOSONAR

private final boolean modernizedMatchingEnabled;
private final DeduplicationService deduplicationService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
@SuppressWarnings({"java:S125", "java:S3776", "java:S6204", "java:S1141", "java:S1118", "java:S1186", "java:S6809", "java:S6541", "java:S2139", "java:S3740",
"java:S1149", "java:S112", "java:S107", "java:S1195", "java:S1135", "java:S6201", "java:S1192", "java:S135", "java:S117"})
public class ProviderMatchingService extends ProviderMatchingBaseService implements IProviderMatchingService {
private static final Logger logger = LoggerFactory.getLogger(ProviderMatchingService.class);
private static final Logger logger = LoggerFactory.getLogger(ProviderMatchingService.class); // NOSONAR

public ProviderMatchingService(
EdxPatientMatchRepositoryUtil edxPatientMatchRepositoryUtil,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ protected void setPersonHashCdNok(PersonContainer personContainer) throws DataPr
}

@SuppressWarnings("java:S3776")
protected void setPersonToMatchEntityNok(PersonContainer personContainer) throws DataProcessingException {
protected void setPersonToMatchEntityNok(PersonContainer personContainer) {
Long patientUid = personContainer.getThePersonDto().getPersonUid();
EdxPatientMatchDto edxPatientMatchDto;
String cdDescTxt = personContainer.thePersonDto.getCdDescTxt();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,11 @@ public void setAssociations(Long investigationUID,
Collection<Object> summaryDTColl,
Collection<Object> treatmentSumColl,
Boolean isNNDResendCheckRequired) throws DataProcessingException {
InvestigationContainer invVO = new InvestigationContainer();
if(reportSumVOCollection!=null && !reportSumVOCollection.isEmpty() ){
setObservationAssociationsImpl(investigationUID, reportSumVOCollection);
}
if(isNNDResendCheckRequired){
invVO = getInvestigationProxy(investigationUID);
var invVO = getInvestigationProxy(investigationUID);
updateAutoResendNotificationsAsync(invVO);
}
if(reportSumVOCollection!=null && !reportSumVOCollection.isEmpty()){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public ObservationUtil() {
public Long getUid(Collection<ParticipationDto> participationDtoCollection,
Collection<ActRelationshipDto> actRelationshipDtoCollection,
String uidListType, String uidClassCd, String uidTypeCd,
String uidActClassCd, String uidRecordStatusCd) throws DataProcessingException {
String uidActClassCd, String uidRecordStatusCd) {
Long anUid = null;

if (participationDtoCollection != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,12 @@ public long createOrganization(OrganizationContainer organizationContainer)
/**
* Starts inserting a new organization
*/
if (organizationContainer != null) {
try {
// Upper stream require this id to not mutated (must be negative), so falseToNew Method can parse the id correctly
organizationContainer.getTheOrganizationDto().setOrganizationUid(organizationUid);
organizationContainer.getTheOrganizationDto().setLocalId(localUid);
organizationContainer.getTheOrganizationDto().setVersionCtrlNbr(1);
insertOrganization(organizationContainer);
} catch (Exception e) {
throw new DataProcessingException(e.getMessage(), e);
}
// Upper stream require this id to not mutated (must be negative), so falseToNew Method can parse the id correctly
organizationContainer.getTheOrganizationDto().setOrganizationUid(organizationUid);
organizationContainer.getTheOrganizationDto().setLocalId(localUid);
organizationContainer.getTheOrganizationDto().setVersionCtrlNbr(1);
insertOrganization(organizationContainer);

}
if (organizationContainer.getTheOrganizationNameDtoCollection() != null && !organizationContainer.getTheOrganizationNameDtoCollection().isEmpty()) {
insertOrganizationNames(organizationContainer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void getPageAnswerDTMaps_Success() {


@Test
void testGetNbsAnswerAndAssociationResultNotPresent() throws DataProcessingException {
void testGetNbsAnswerAndAssociationResultNotPresent() {
Long uid = 1L;

when(nbsActEntityRepository.getNbsActEntitiesByActUid(uid)).thenReturn(Optional.empty());
Expand All @@ -121,7 +121,7 @@ void testGetNbsAnswerAndAssociationResultNotPresent() throws DataProcessingExcep


@Test
void getNbsAnswerAndAssociation_Success() throws DataProcessingException {
void getNbsAnswerAndAssociation_Success() {
long uid = 10L;

// getPageAnswerDTMaps 52
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void initiatingInvestigationAndPublicHealthCase_NoFurther() throws DataProcessin


@Test
void initiatingInvestigationAndPublicHealthCase_Exception() throws DataProcessingException {
void initiatingInvestigationAndPublicHealthCase_Exception() {
PublicHealthCaseFlowContainer publicHealthCaseFlowContainer = new PublicHealthCaseFlowContainer();
var edxLabInfoDto = new EdxLabInformationDto();
var obsDto = new ObservationDto();
Expand Down Expand Up @@ -1084,7 +1084,7 @@ void initiateStep1KafkaFailed_ResetCache() {
}

@Test
void initiateStep2KafkaFailed() throws DataProcessingException {
void initiateStep2KafkaFailed() {
Integer nbsId = 1;

var nbs = new NbsInterfaceModel();
Expand All @@ -1098,7 +1098,7 @@ void initiateStep2KafkaFailed() throws DataProcessingException {
}

@Test
void initiateStep2KafkaFailed_ResetCache() throws DataProcessingException {
void initiateStep2KafkaFailed_ResetCache() {
Integer nbsId = 1;
PropertyUtilCache.kafkaFailedCheckStep2 = 100000;
var nbs = new NbsInterfaceModel();
Expand All @@ -1114,7 +1114,7 @@ void initiateStep2KafkaFailed_ResetCache() throws DataProcessingException {
}

@Test
void initiateStep3KafkaFailed() throws DataProcessingException {
void initiateStep3KafkaFailed() {
Integer nbsId = 1;

var nbs = new NbsInterfaceModel();
Expand All @@ -1130,7 +1130,7 @@ void initiateStep3KafkaFailed() throws DataProcessingException {


@Test
void initiateStep3KafkaFailed_ResetCache() throws DataProcessingException {
void initiateStep3KafkaFailed_ResetCache() {
Integer nbsId = 1;
PropertyUtilCache.kafkaFailedCheckStep3 = 100000;
var nbs = new NbsInterfaceModel();
Expand Down

0 comments on commit 646e9eb

Please sign in to comment.