Skip to content

Commit

Permalink
Cnde 1565 3 (#236)
Browse files Browse the repository at this point in the history
* remove last two high code smell

* resolve S112

* global ignore S1118 for DI

* medium complaint for DI

* solve S1135

* resolving some low priority complaint

* clean up

* ignoring brain method complaint

* clean up comment note

* fix failed unit test

* addessing S5145 security

* clean up

* remove unused import

* replace e.printstacktrace with logger

* handle 2139 complaint
  • Loading branch information
ndduc01 authored Oct 30, 2024
1 parent 782210b commit cd6a024
Show file tree
Hide file tree
Showing 728 changed files with 4,741 additions and 555 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
* Report service application.
*/
@SpringBootApplication
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class ServiceApplication {
/**
* Main method for spring boot application.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
import java.util.List;

@Component
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class ElrProcessStatusComponent {
private static Logger logger = LoggerFactory.getLogger(ElrProcessStatusComponent.class);
private ReportStatusService reportStatusService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
import org.springframework.stereotype.Component;

@Component
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class HL7FileProcessComponent {
private static Logger logger = LoggerFactory.getLogger(HL7FileProcessComponent.class);
String msgType = "HL7";
Expand All @@ -19,7 +26,7 @@ public HL7FileProcessComponent(RawELRService rawELRService){
this.rawELRService=rawELRService;
}
@Handler
public String process(String body) throws Exception {
public String process(String body) {
String elrId = "";
String version="1";
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@

@Component
@ConditionalOnProperty(name = "sftp.enabled", havingValue = "enabled")
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class SFTPRouteBuilder extends RouteBuilder {
private static Logger logger = LoggerFactory.getLogger(SFTPRouteBuilder.class);
@Value("${sftp.host}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
import org.springframework.context.annotation.Configuration;

@Configuration
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class ClassConfig {

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
}
)
@Configuration
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class DataSourceConfig {
private static final Logger logger = LoggerFactory.getLogger(DataSourceConfig.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
@Slf4j
@EnableKafka
@Configuration
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class KafkaConsumerConfig {
@Value("${spring.kafka.group-id}")
private String groupId = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
import java.util.Map;

@Configuration
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class KafkaProducerConfig {
@Value("${spring.kafka.bootstrap-servers}")
private String bootstrapServers = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
import java.util.Map;

@Configuration
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class KafkaProducerTransactionConfig {
@Value("${spring.kafka.bootstrap-servers}")
private String bootstrapServers = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
"gov.cdc.dataingestion.nbs.repository"
}
)
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class NbsDataSourceConfig {
@Value("${spring.datasource.driverClassName}")
private String driverClassName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
"gov.cdc.dataingestion.odse.repository",
}
)
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class OdseDataSourceConfig {
@Value("${spring.datasource.driverClassName}")
private String driverClassName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
import java.util.List;

@Configuration
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class OpenAPIConfig {
@Value("${diserver.host}")
private String serverhost;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package gov.cdc.dataingestion.constant;

/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class KafkaHeaderValue {
private KafkaHeaderValue() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package gov.cdc.dataingestion.constant;

/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class MessageType {
public static final String HL7_ELR = "HL7";
public static final String XML_ELR = "HL7-XML";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
import org.springframework.stereotype.Component;

@Component
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class CustomMetricsBuilder {
Counter customMessagesProcessed;
Counter customMessagesValidated;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
import org.springframework.stereotype.Component;

@Component
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class TimeMetricsBuilder {
Timer elrRawEventTimer;
Timer elrRawXmlEventTimer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
@RequiredArgsConstructor
@SecurityRequirement(name = "bearer-key")
@Tag(name = "ELR Dead Letter", description = "Elr Dead Letter Messages")
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class ElrDeadLetterController {

private final ElrDeadLetterService elrDeadLetterService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@

@Getter
@Setter
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class ElrDeadLetterDto {

private String errorMessageId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
@Setter
@Entity
@Table(name = "elr_dlt")
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class ElrDeadLetterModel {

@Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@

@Service
@Slf4j
/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class ElrDeadLetterService {
private final IElrDeadLetterRepository dltRepository;
private final IRawELRRepository rawELRRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package gov.cdc.dataingestion.exception;

/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class ConversionPrepareException extends Exception{
public ConversionPrepareException(String message) {
super(message);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package gov.cdc.dataingestion.exception;

/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class DeadLetterTopicException extends Exception{
public DeadLetterTopicException(String message) {
super(message);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package gov.cdc.dataingestion.exception;

/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class DiAsyncException extends RuntimeException {
public DiAsyncException(String message) {
super(message);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package gov.cdc.dataingestion.exception;

/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class DuplicateHL7FileFoundException extends Exception {

public DuplicateHL7FileFoundException(String message) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package gov.cdc.dataingestion.exception;

/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class EcrCdaXmlException extends Exception {
public EcrCdaXmlException(String message) {
super(message);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package gov.cdc.dataingestion.exception;

/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class FhirConversionException extends Exception {

public FhirConversionException(String message) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package gov.cdc.dataingestion.exception;

/**
1118 - require constructor complaint
125 - comment complaint
6126 - String block complaint
1135 - todos complaint
* */
@SuppressWarnings({"java:S1118","java:S125", "java:S6126", "java:S1135"})
public class XmlConversionException extends Exception {
public XmlConversionException(String message) {
super(message);
Expand Down
Loading

0 comments on commit cd6a024

Please sign in to comment.