Skip to content

Commit

Permalink
minor refactor + fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
etsybaev committed Jan 19, 2022
1 parent ee4a894 commit 010f36f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package io.airbyte.integrations.destination.bigquery;

import static io.airbyte.integrations.destination.bigquery.helpers.LoggerHelper.getJobErrorMessage;
import static java.util.Objects.isNull;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
Expand Down Expand Up @@ -172,9 +171,9 @@ public static String getDatasetId(final JsonNode config) {
String projectId = config.get(BigQueryConsts.CONFIG_PROJECT_ID).asText();
if (!(projectId.equals(projectIdPart))) {
throw new IllegalArgumentException(String.format(
"Project ID included in Dataset ID must match Project ID field's value: Project ID is `%s`, but you specified `%s` in Dataset ID",
projectId,
projectIdPart));
"Project ID included in Dataset ID must match Project ID field's value: Project ID is `%s`, but you specified `%s` in Dataset ID",
projectId,
projectIdPart));
}
}
// if colonIndex is -1, then this returns the entire string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ private boolean isTablePartitioned(final BigQuery bigquery, final Dataset datase
}

private static class DatasetIdResetter {

private Consumer<JsonNode> consumer;

DatasetIdResetter(Consumer<JsonNode> consumer) {
Expand All @@ -394,20 +395,20 @@ private static class DatasetIdResetter {
public void accept(JsonNode config) {
consumer.accept(config);
}

}

private static Stream<Arguments> datasetIdResetterProvider() {
// parameterized test with two dataset-id patterns: `dataset_id` and `project-id:dataset_id`
return Stream.of(
Arguments.arguments(new DatasetIdResetter(config -> {})),
Arguments.arguments(new DatasetIdResetter(
config -> {
String projectId = ((ObjectNode) config).get(BigQueryConsts.CONFIG_PROJECT_ID).asText();
String datasetId = ((ObjectNode) config).get(BigQueryConsts.CONFIG_DATASET_ID).asText();
((ObjectNode) config).put(BigQueryConsts.CONFIG_DATASET_ID,
String.format("%s:%s", projectId, datasetId));
}
))
);
Arguments.arguments(new DatasetIdResetter(config -> {})),
Arguments.arguments(new DatasetIdResetter(
config -> {
String projectId = ((ObjectNode) config).get(BigQueryConsts.CONFIG_PROJECT_ID).asText();
String datasetId = ((ObjectNode) config).get(BigQueryConsts.CONFIG_DATASET_ID).asText();
((ObjectNode) config).put(BigQueryConsts.CONFIG_DATASET_ID,
String.format("%s:%s", projectId, datasetId));
})));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void init() {
.put(BigQueryConsts.CONFIG_CREDS, "test_secret")
.put(BigQueryConsts.CONFIG_DATASET_LOCATION, "US");
}

@ParameterizedTest
@MethodSource("validBigQueryIdProvider")
public void testGetDatasetIdSuccess(String projectId, String datasetId, String expected) throws Exception {
Expand Down Expand Up @@ -66,4 +66,5 @@ private static Stream<Arguments> invalidBigQueryIdProvider() {
Arguments.arguments("my-project", "your-project:my_dataset",
"Project ID included in Dataset ID must match Project ID field's value: Project ID is `my-project`, but you specified `your-project` in Dataset ID"));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ public static boolean shouldPurgeStagingData(final JsonNode config) {
}
}

public static S3CopyConfig getS3CopyConfig(final JsonNode config) {
return new S3CopyConfig(S3CopyConfig.shouldPurgeStagingData(config),
S3DestinationConfig.getS3DestinationConfig(config));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public AirbyteMessageConsumer getConsumer(final JsonNode config,
getDatabase(config),
getSqlOperations(),
getNameTransformer(),
new S3CopyConfig(S3CopyConfig.shouldPurgeStagingData(config), getS3DestinationConfig(config)),
S3CopyConfig.getS3CopyConfig(config),
catalog,
new RedshiftStreamCopierFactory(),
getConfiguredSchema(config));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public AirbyteMessageConsumer getConsumer(final JsonNode config,
getDatabase(config),
getSqlOperations(),
getNameTransformer(),
getS3CopyConfig(config),
S3CopyConfig.getS3CopyConfig(config.get("loading_method")),
catalog,
new SnowflakeS3StreamCopierFactory(),
getConfiguredSchema(config));
Expand Down Expand Up @@ -59,10 +59,6 @@ private String getConfiguredSchema(final JsonNode config) {
return config.get("schema").asText();
}

private S3CopyConfig getS3CopyConfig(final JsonNode config) {
return new S3CopyConfig(S3CopyConfig.shouldPurgeStagingData(config), getS3DestinationConfig(config));
}

private S3DestinationConfig getS3DestinationConfig(final JsonNode config) {
final JsonNode loadingMethod = config.get("loading_method");
return S3DestinationConfig.getS3DestinationConfig(loadingMethod);
Expand Down

5 comments on commit 010f36f

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SonarQube report for Airbyte Connectors Source Snowflake(#9531)

Measures

Name Value Name Value Name Value
Bugs 0 Reliability Rating A Security Rating A
Code Smells 3 Quality Gate Status OK Coverage 0.0
Lines to Cover 39 Lines of Code 87 Duplicated Lines (%) 0.0
Duplicated Blocks 0 Vulnerabilities 0 Blocker Issues 0
Critical Issues 3 Major Issues 0 Minor Issues 0

Detected Issues

Rule File Description Message
java:S1598 (CRITICAL) io.airbyte.integrations.source.snowflake/SnowflakeSourceOperations.java:5 Package declaration should match source file directory This file "SnowflakeSourceOperations.java" should be located in "io/airbyte/integrations/source/snowflake" directory, not in "/github/workspace/airbyte-integrations/connectors/source-snowflake/src/main/java/io.airbyte.integrations.source.snowflake"(Do not use dots in directory names).
java:S1598 (CRITICAL) io.airbyte.integrations.source.snowflake/SnowflakeJdbcStreamingQueryConfiguration.java:5 Package declaration should match source file directory This file "SnowflakeJdbcStreamingQueryConfiguration.java" should be located in "io/airbyte/integrations/source/snowflake" directory, not in "/github/workspace/airbyte-integrations/connectors/source-snowflake/src/main/java/io.airbyte.integrations.source.snowflake"(Do not use dots in directory names).
java:S1598 (CRITICAL) io.airbyte.integrations.source.snowflake/SnowflakeSource.java:5 Package declaration should match source file directory This file "SnowflakeSource.java" should be located in "io/airbyte/integrations/source/snowflake" directory, not in "/github/workspace/airbyte-integrations/connectors/source-snowflake/src/main/java/io.airbyte.integrations.source.snowflake"(Do not use dots in directory names).

Coverage (0.0%)

File Coverage File Coverage
src/main/java/io.airbyte.integrations.source.snowflake/SnowflakeJdbcStreamingQueryConfiguration.java 0.0 src/main/java/io.airbyte.integrations.source.snowflake/SnowflakeSource.java 0.0
src/main/java/io.airbyte.integrations.source.snowflake/SnowflakeSourceOperations.java 0.0

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SonarQube report for Airbyte Connectors Destination Snowflake(#9531)

Measures

Name Value Name Value Name Value
Lines to Cover 327 Coverage 0.0 Quality Gate Status OK
Duplicated Blocks 0 Bugs 0 Duplicated Lines (%) 0.0
Security Rating A Vulnerabilities 0 Reliability Rating A
Lines of Code 764 Code Smells 12 Blocker Issues 0
Critical Issues 3 Major Issues 6 Minor Issues 3

Detected Issues

Rule File Description Message
java:S116 (MINOR) snowflake/SnowflakeInternalStagingConsumerFactory.java:49 Field names should comply with a naming convention Rename this field "CURRENT_SYNC_PATH" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
java:S112 (MAJOR) snowflake/SnowflakeInternalStagingDestination.java:50 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S5361 (CRITICAL) snowflake/SnowflakeInternalStagingDestination.java:53 "String#replace" should be preferred to "String#replaceAll" Replace this call to "replaceAll()" by a call to the "replace()" method.
java:S1116 (MINOR) snowflake/SnowflakeInternalStagingDestination.java:54 Empty statements should be removed Remove this empty statement.
java:S1192 (CRITICAL) snowflake/SnowflakeDestination.java:42 String literals should not be duplicated Define a constant instead of duplicating this literal "loading_method" 9 times.
java:S1611 (MINOR) snowflake/SnowflakeInternalStagingConsumerFactory.java:164 Parentheses should be removed from a single lambda input parameter when its type is inferred Remove the parentheses around the "hasFailed" parameter (sonar.java.source not set. Assuming 8 or greater.)
java:S108 (MAJOR) snowflake/SnowflakeInternalStagingConsumerFactory.java:190 Nested blocks of code should not be left empty Either remove or fill this block of code.
java:S5361 (CRITICAL) snowflake/SnowflakeSQLNameTransformer.java:17 "String#replace" should be preferred to "String#replaceAll" Replace this call to "replaceAll()" by a call to the "replace()" method.
java:S112 (MAJOR) snowflake/SnowflakeStagingSqlOperations.java:35 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) snowflake/SnowflakeStagingSqlOperations.java:39 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S1068 (MAJOR) snowflake/SnowflakeInsertDestination.java:17 Unused "private" fields should be removed Remove this unused "LOGGER" private field.
java:S1118 (MAJOR) snowflake/SnowflakeDatabase.java:20 Utility classes should not have public constructors Add a private constructor to hide the implicit public one.

Coverage (0.0%)

File Coverage File Coverage
src/main/java/io/airbyte/integrations/destination/snowflake/SnowflakeCopyGcsDestination.java 0.0 src/main/java/io/airbyte/integrations/destination/snowflake/SnowflakeCopyS3Destination.java 0.0
src/main/java/io/airbyte/integrations/destination/snowflake/SnowflakeDatabase.java 0.0 src/main/java/io/airbyte/integrations/destination/snowflake/SnowflakeDestination.java 0.0
src/main/java/io/airbyte/integrations/destination/snowflake/SnowflakeGcsStreamCopier.java 0.0 src/main/java/io/airbyte/integrations/destination/snowflake/SnowflakeGcsStreamCopierFactory.java 0.0
src/main/java/io/airbyte/integrations/destination/snowflake/SnowflakeInsertDestination.java 0.0 src/main/java/io/airbyte/integrations/destination/snowflake/SnowflakeInternalStagingConsumerFactory.java 0.0
src/main/java/io/airbyte/integrations/destination/snowflake/SnowflakeInternalStagingDestination.java 0.0 src/main/java/io/airbyte/integrations/destination/snowflake/SnowflakeS3StreamCopier.java 0.0
src/main/java/io/airbyte/integrations/destination/snowflake/SnowflakeS3StreamCopierFactory.java 0.0 src/main/java/io/airbyte/integrations/destination/snowflake/SnowflakeSQLNameTransformer.java 0.0
src/main/java/io/airbyte/integrations/destination/snowflake/SnowflakeSqlOperations.java 0.0 src/main/java/io/airbyte/integrations/destination/snowflake/SnowflakeStagingSqlOperations.java 0.0

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SonarQube report for Airbyte Connectors Destination Bigquery(#9531)

Measures

Name Value Name Value Name Value
Quality Gate Status OK Duplicated Lines (%) 0.0 Duplicated Blocks 0
Lines of Code 1194 Code Smells 34 Security Rating A
Bugs 2 Coverage 0.0 Lines to Cover 562
Reliability Rating C Vulnerabilities 0 Blocker Issues 0
Critical Issues 3 Major Issues 29 Minor Issues 3

Detected Issues

Rule File Description Message
java:S1452 (CRITICAL) uploader/BigQueryUploaderFactory.java:39 Generic wildcard types should not be used in return types Remove usage of generic wildcard type.
java:S5993 (MAJOR) formatter/BigQueryRecordFormatter.java:31 Constructors of an "abstract" class should not be declared "public" Change the visibility of this constructor to "protected".
java:S1116 (MINOR) formatter/BigQueryRecordFormatter.java:39 Empty statements should be removed Remove this empty statement.
java:S112 (MAJOR) uploader/AbstractBigQueryUploader.java:56 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) uploader/AbstractBigQueryUploader.java:70 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S3457 (MAJOR) uploader/AbstractBigQueryUploader.java:88 Printf-style format strings should be used correctly %n should be used in place of \n to produce the platform-specific line separator.
java:S112 (MAJOR) uploader/AbstractBigQueryUploader.java:90 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S125 (MAJOR) uploader/AbstractBigQueryUploader.java:111 Sections of code should not be commented out This block of commented-out lines of code should be removed.
java:S112 (MAJOR) uploader/AbstractBigQueryUploader.java:120 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S2142 (MAJOR) uploader/AbstractBigQueryUploader.java:166 "InterruptedException" should not be ignored Either re-interrupt this method or rethrow the "InterruptedException" that can be caught here.
java:S112 (MAJOR) uploader/AbstractBigQueryUploader.java:185 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S2142 (MAJOR) uploader/AbstractGscBigQueryUploader.java:84 "InterruptedException" should not be ignored Either re-interrupt this method or rethrow the "InterruptedException" that can be caught here.
java:S112 (MAJOR) uploader/AbstractGscBigQueryUploader.java:86 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S1124 (MINOR) uploader/AbstractGscBigQueryUploader.java:90 Modifiers should be declared in the correct order Reorder the modifiers to comply with the Java Language Specification.
java:S1117 (MAJOR) uploader/AbstractGscBigQueryUploader.java:98 Local variables should not shadow class fields Rename "gcsDestinationConfig" which hides the field declared at line 33.
java:S1068 (MAJOR) uploader/BigQueryDirectUploader.java:18 Unused "private" fields should be removed Remove this unused "LOGGER" private field.
java:S1118 (MAJOR) uploader/BigQueryUploaderFactory.java:35 Utility classes should not have public constructors Add a private constructor to hide the implicit public one.
java:S1068 (MAJOR) uploader/BigQueryUploaderFactory.java:37 Unused "private" fields should be removed Remove this unused "LOGGER" private field.
java:S107 (MAJOR) uploader/BigQueryUploaderFactory.java:88 Methods should not have too many parameters Method has 8 parameters, which is greater than 7 authorized.
java:S1068 (MAJOR) config/UploaderConfig.java:20 Unused "private" fields should be removed Remove this unused "config" private field.
java:S1068 (MAJOR) config/UploaderConfig.java:21 Unused "private" fields should be removed Remove this unused "configStream" private field.
java:S1068 (MAJOR) config/UploaderConfig.java:22 Unused "private" fields should be removed Remove this unused "targetTableName" private field.
java:S1068 (MAJOR) config/UploaderConfig.java:23 Unused "private" fields should be removed Remove this unused "tmpTableName" private field.
java:S1068 (MAJOR) config/UploaderConfig.java:24 Unused "private" fields should be removed Remove this unused "bigQuery" private field.
java:S1068 (MAJOR) config/UploaderConfig.java:25 Unused "private" fields should be removed Remove this unused "formatterMap" private field.
java:S1068 (MAJOR) config/UploaderConfig.java:26 Unused "private" fields should be removed Remove this unused "isDefaultAirbyteTmpSchema" private field.
java:S1068 (MAJOR) writer/BigQueryTableWriter.java:19 Unused "private" fields should be removed Remove this unused "LOGGER" private field.
java:S1186 (CRITICAL) writer/BigQueryTableWriter.java:28 Methods should not be empty Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.
java:S1118 (MAJOR) bigquery/BigQueryConsts.java:7 Utility classes should not have public constructors Add a private constructor to hide the implicit public one.
java:S115 (CRITICAL) bigquery/BigQueryConsts.java:9 Constant names should comply with a naming convention Rename this constant name to match the regular expression '^[A-Z][A-Z0-9](_[A-Z0-9]+)$'.
java:S1450 (MINOR) bigquery/BigQueryRecordConsumer.java:24 Private fields only used as local variables in methods should become local variables Remove the "lastStateMessage" field and declare it as a local variable in the relevant methods.
java:S1135 (INFO) bigquery/BigQueryRecordConsumer.java:34 Track uses of "TODO" tags Complete the task associated to this TODO comment.
java:S1118 (MAJOR) bigquery/BigQueryUtils.java:45 Utility classes should not have public constructors Add a private constructor to hide the implicit public one.
java:S112 (MAJOR) bigquery/BigQueryUtils.java:60 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) bigquery/BigQueryUtils.java:75 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) bigquery/BigQueryDestination.java:117 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.

Coverage (0.0%)

File Coverage File Coverage
src/main/java/io/airbyte/integrations/destination/bigquery/BigQueryConsts.java 0.0 src/main/java/io/airbyte/integrations/destination/bigquery/BigQueryDestination.java 0.0
src/main/java/io/airbyte/integrations/destination/bigquery/BigQueryRecordConsumer.java 0.0 src/main/java/io/airbyte/integrations/destination/bigquery/BigQuerySQLNameTransformer.java 0.0
src/main/java/io/airbyte/integrations/destination/bigquery/BigQueryUtils.java 0.0 src/main/java/io/airbyte/integrations/destination/bigquery/formatter/BigQueryRecordFormatter.java 0.0
src/main/java/io/airbyte/integrations/destination/bigquery/formatter/DefaultBigQueryRecordFormatter.java 0.0 src/main/java/io/airbyte/integrations/destination/bigquery/formatter/GcsAvroBigQueryRecordFormatter.java 0.0
src/main/java/io/airbyte/integrations/destination/bigquery/formatter/GcsCsvBigQueryRecordFormatter.java 0.0 src/main/java/io/airbyte/integrations/destination/bigquery/helpers/LoggerHelper.java 0.0
src/main/java/io/airbyte/integrations/destination/bigquery/uploader/AbstractBigQueryUploader.java 0.0 src/main/java/io/airbyte/integrations/destination/bigquery/uploader/AbstractGscBigQueryUploader.java 0.0
src/main/java/io/airbyte/integrations/destination/bigquery/uploader/BigQueryDirectUploader.java 0.0 src/main/java/io/airbyte/integrations/destination/bigquery/uploader/BigQueryUploaderFactory.java 0.0
src/main/java/io/airbyte/integrations/destination/bigquery/uploader/GcsAvroBigQueryUploader.java 0.0 src/main/java/io/airbyte/integrations/destination/bigquery/uploader/GcsCsvBigQueryUploader.java 0.0
src/main/java/io/airbyte/integrations/destination/bigquery/writer/BigQueryTableWriter.java 0.0

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SonarQube report for Airbyte Connectors Destination Redshift(#9531)

Measures

Name Value Name Value Name Value
Security Rating A Duplicated Blocks 0 Code Smells 5
Quality Gate Status OK Duplicated Lines (%) 0.0 Bugs 0
Reliability Rating A Coverage 0.0 Lines to Cover 165
Vulnerabilities 0 Lines of Code 389 Blocker Issues 0
Critical Issues 2 Major Issues 3 Minor Issues 0

Detected Issues

Rule File Description Message
java:S1192 (CRITICAL) redshift/RedshiftInsertDestination.java:50 String literals should not be duplicated Define a constant instead of duplicating this literal "username" 3 times.
java:S1192 (CRITICAL) redshift/RedshiftInsertDestination.java:51 String literals should not be duplicated Define a constant instead of duplicating this literal "password" 4 times.
java:S112 (MAJOR) redshift/RedshiftStreamCopier.java:98 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) redshift/RedshiftDestination.java:70 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S1068 (MAJOR) redshift/RedshiftInsertDestination.java:22 Unused "private" fields should be removed Remove this unused "LOGGER" private field.

Coverage (0.0%)

File Coverage File Coverage
src/main/java/io/airbyte/integrations/destination/redshift/manifest/Entry.java 0.0 src/main/java/io/airbyte/integrations/destination/redshift/manifest/Manifest.java 0.0
src/main/java/io/airbyte/integrations/destination/redshift/RedshiftCopyS3Destination.java 0.0 src/main/java/io/airbyte/integrations/destination/redshift/RedshiftDestination.java 0.0
src/main/java/io/airbyte/integrations/destination/redshift/RedshiftInsertDestination.java 0.0 src/main/java/io/airbyte/integrations/destination/redshift/RedshiftSQLNameTransformer.java 0.0
src/main/java/io/airbyte/integrations/destination/redshift/RedshiftSqlOperations.java 0.0 src/main/java/io/airbyte/integrations/destination/redshift/RedshiftStreamCopier.java 0.0
src/main/java/io/airbyte/integrations/destination/redshift/RedshiftStreamCopierFactory.java 0.0

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SonarQube report for Airbyte Connectors Destination Jdbc(#9531)

Measures

Name Value Name Value Name Value
Reliability Rating A Duplicated Lines (%) 4.8 Quality Gate Status OK
Security Rating A Lines to Cover 659 Vulnerabilities 0
Coverage 0.0 Duplicated Blocks 6 Bugs 0
Code Smells 71 Lines of Code 1541 Blocker Issues 0
Critical Issues 7 Major Issues 55 Minor Issues 4

Detected Issues

Rule File Description Message
common-java:DuplicatedBlocks (MAJOR) s3/S3StreamCopier.java Source files should not have any duplicated blocks 3 duplicated blocks of code must be removed.
java:S1116 (MINOR) jdbc/JdbcSqlOperations.java:34 Empty statements should be removed Remove this empty statement.
java:S112 (MAJOR) jdbc/SqlOperations.java:33 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S1214 (CRITICAL) constants/GlobalDataSizeConstants.java:10 Constants should not be defined in interfaces Move constants defined in this interfaces to another class or enum.
common-java:DuplicatedBlocks (MAJOR) s3/LegacyS3StreamCopier.java Source files should not have any duplicated blocks 3 duplicated blocks of code must be removed.
java:S1133 (INFO) s3/LegacyS3StreamCopier.java:41 Deprecated code should be removed Do not forget to remove this deprecated code someday.
java:S5993 (MAJOR) s3/LegacyS3StreamCopier.java:64 Constructors of an "abstract" class should not be declared "public" Change the visibility of this constructor to "protected".
java:S107 (MAJOR) s3/LegacyS3StreamCopier.java:64 Methods should not have too many parameters Constructor has 9 parameters, which is greater than 7 authorized.
java:S125 (MAJOR) s3/LegacyS3StreamCopier.java:97 Sections of code should not be commented out This block of commented-out lines of code should be removed.
java:S112 (MAJOR) s3/LegacyS3StreamCopier.java:117 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S1602 (MINOR) s3/LegacyS3StreamCopier.java:157 Lambdas containing only one statement should not nest this statement in a block Remove useless curly braces around statement (sonar.java.source not set. Assuming 8 or greater.)
java:S1123 (MAJOR) s3/LegacyS3StreamCopierFactory.java:22 Deprecated elements should have both the annotation and the Javadoc tag Add the missing @deprecated Javadoc tag.
java:S1133 (INFO) s3/LegacyS3StreamCopierFactory.java:22 Deprecated code should be removed Do not forget to remove this deprecated code someday.
java:S112 (MAJOR) s3/LegacyS3StreamCopierFactory.java:43 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S3252 (CRITICAL) s3/S3StreamCopier.java:152 "static" base class members should not be accessed via derived types Use static access with "!Unknown!" for "Entry".
java:S3252 (CRITICAL) s3/S3StreamCopier.java:184 "static" base class members should not be accessed via derived types Use static access with "!Unknown!" for "Entry".
java:S107 (MAJOR) s3/S3StreamCopierFactory.java:43 Methods should not have too many parameters Method has 8 parameters, which is greater than 7 authorized.
java:S1135 (INFO) jdbc/SqlOperationsUtils.java:84 Track uses of "TODO" tags Complete the task associated to this TODO comment.
java:S125 (MAJOR) jdbc/StagingFilenameGenerator.java:18 Sections of code should not be commented out This block of commented-out lines of code should be removed.
java:S5361 (CRITICAL) jdbc/AbstractJdbcDestination.java:77 "String#replace" should be preferred to "String#replaceAll" Replace this call to "replaceAll()" by a call to the "replace()" method.
java:S1172 (MAJOR) jdbc/JdbcBufferedConsumerFactory.java:80 Unused method parameters should be removed Remove this unused method parameter "now".
java:S112 (MAJOR) jdbc/JdbcSqlOperations.java:58 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S6213 (MAJOR) jdbc/JdbcSqlOperations.java:64 Restricted Identifiers should not be used as Identifiers Rename this variable to not match a restricted identifier.
java:S107 (MAJOR) copy/CopyConsumerFactory.java:34 Methods should not have too many parameters Method has 8 parameters, which is greater than 7 authorized.
java:S5993 (MAJOR) copy/CopyDestination.java:30 Constructors of an "abstract" class should not be declared "public" Change the visibility of this constructor to "protected".
java:S5993 (MAJOR) gcs/GcsStreamCopier.java:69 Constructors of an "abstract" class should not be declared "public" Change the visibility of this constructor to "protected".
java:S107 (MAJOR) gcs/GcsStreamCopier.java:69 Methods should not have too many parameters Constructor has 9 parameters, which is greater than 7 authorized.
java:S5993 (MAJOR) s3/S3StreamCopier.java:66 Constructors of an "abstract" class should not be declared "public" Change the visibility of this constructor to "protected".
java:S107 (MAJOR) s3/S3StreamCopier.java:66 Methods should not have too many parameters Constructor has 10 parameters, which is greater than 7 authorized.
java:S112 (MAJOR) copy/StreamCopier.java:19 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) s3/S3StreamCopier.java:116 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S5993 (MAJOR) copy/CopyDestination.java:28 Constructors of an "abstract" class should not be declared "public" Change the visibility of this constructor to "protected".
java:S1068 (MAJOR) jdbc/DataAdapter.java:16 Unused "private" fields should be removed Remove this unused "LOGGER" private field.
java:S112 (MAJOR) jdbc/DataAdapter.java:61 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S1068 (MAJOR) jdbc/JdbcSqlOperations.java:27 Unused "private" fields should be removed Remove this unused "LOGGER" private field.
java:S112 (MAJOR) jdbc/JdbcSqlOperations.java:135 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S1192 (CRITICAL) gcs/GcsConfig.java:35 String literals should not be duplicated Define a constant instead of duplicating this literal "loading_method" 3 times.
java:S1118 (MAJOR) copy/CopyConsumerFactory.java:30 Utility classes should not have public constructors Add a private constructor to hide the implicit public one.
java:S1135 (INFO) copy/CopyConsumerFactory.java:94 Track uses of "TODO" tags Complete the task associated to this TODO comment.
java:S1611 (MINOR) copy/CopyConsumerFactory.java:108 Parentheses should be removed from a single lambda input parameter when its type is inferred Remove the parentheses around the "hasFailed" parameter (sonar.java.source not set. Assuming 8 or greater.)
java:S112 (MAJOR) jdbc/SqlOperations.java:106 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) gcs/GcsStreamCopier.java:111 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S5361 (CRITICAL) gcs/GcsStreamCopier.java:203 "String#replace" should be preferred to "String#replaceAll" Replace this call to "replaceAll()" by a call to the "replace()" method.
java:S112 (MAJOR) gcs/GcsStreamCopierFactory.java:49 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S107 (MAJOR) gcs/GcsStreamCopierFactory.java:56 Methods should not have too many parameters Method has 9 parameters, which is greater than 7 authorized.
java:S112 (MAJOR) gcs/GcsStreamCopierFactory.java:65 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S2093 (CRITICAL) jdbc/JdbcSqlOperations.java:60 Try-with-resources should be used Change this "try" to a try-with-resources. (sonar.java.source not set. Assuming 7 or greater.)
java:S112 (MAJOR) jdbc/SqlOperations.java:85 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S5993 (MAJOR) jdbc/AbstractJdbcDestination.java:44 Constructors of an "abstract" class should not be declared "public" Change the visibility of this constructor to "protected".
java:S112 (MAJOR) copy/StreamCopier.java:25 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) copy/StreamCopier.java:30 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) copy/StreamCopier.java:36 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) copy/StreamCopier.java:41 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) copy/StreamCopier.java:48 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) copy/StreamCopier.java:53 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) copy/StreamCopier.java:59 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) s3/S3StreamCopierFactory.java:36 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) s3/S3StreamCopierFactory.java:51 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S108 (MAJOR) jdbc/JdbcBufferedConsumerFactory.java:171 Nested blocks of code should not be left empty Either remove or fill this block of code.
java:S108 (MAJOR) jdbc/JdbcBufferedConsumerFactory.java:172 Nested blocks of code should not be left empty Either remove or fill this block of code.
java:S1118 (MAJOR) jdbc/JdbcBufferedConsumerFactory.java:44 Utility classes should not have public constructors Add a private constructor to hide the implicit public one.
java:S1611 (MINOR) jdbc/JdbcBufferedConsumerFactory.java:156 Parentheses should be removed from a single lambda input parameter when its type is inferred Remove the parentheses around the "hasFailed" parameter (sonar.java.source not set. Assuming 8 or greater.)
java:S3457 (MAJOR) jdbc/JdbcSqlOperations.java:39 Printf-style format strings should be used correctly %n should be used in place of \n to produce the platform-specific line separator.
java:S3457 (MAJOR) jdbc/JdbcSqlOperations.java:83 Printf-style format strings should be used correctly %n should be used in place of \n to produce the platform-specific line separator.
java:S3457 (MAJOR) jdbc/JdbcSqlOperations.java:88 Printf-style format strings should be used correctly %n should be used in place of \n to produce the platform-specific line separator.
java:S3457 (MAJOR) jdbc/JdbcSqlOperations.java:108 Printf-style format strings should be used correctly %n should be used in place of \n to produce the platform-specific line separator.
java:S1135 (INFO) jdbc/SqlOperations.java:12 Track uses of "TODO" tags Complete the task associated to this TODO comment.
java:S112 (MAJOR) jdbc/SqlOperations.java:23 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) jdbc/SqlOperations.java:45 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S112 (MAJOR) jdbc/SqlOperations.java:64 Generic exceptions should never be thrown Define and throw a dedicated exception instead of using a generic one.
java:S1118 (MAJOR) jdbc/SqlOperationsUtils.java:20 Utility classes should not have public constructors Add a private constructor to hide the implicit public one.

Coverage (0.0%)

File Coverage File Coverage
src/main/java/io/airbyte/integrations/destination/jdbc/AbstractJdbcDestination.java 0.0 src/main/java/io/airbyte/integrations/destination/jdbc/constants/GlobalDataSizeConstants.java 0.0
src/main/java/io/airbyte/integrations/destination/jdbc/copy/CopyConsumerFactory.java 0.0 src/main/java/io/airbyte/integrations/destination/jdbc/copy/CopyDestination.java 0.0
src/main/java/io/airbyte/integrations/destination/jdbc/copy/gcs/GcsConfig.java 0.0 src/main/java/io/airbyte/integrations/destination/jdbc/copy/gcs/GcsStreamCopier.java 0.0
src/main/java/io/airbyte/integrations/destination/jdbc/copy/gcs/GcsStreamCopierFactory.java 0.0 src/main/java/io/airbyte/integrations/destination/jdbc/copy/s3/LegacyS3StreamCopier.java 0.0
src/main/java/io/airbyte/integrations/destination/jdbc/copy/s3/LegacyS3StreamCopierFactory.java 0.0 src/main/java/io/airbyte/integrations/destination/jdbc/copy/s3/S3CopyConfig.java 0.0
src/main/java/io/airbyte/integrations/destination/jdbc/copy/s3/S3StreamCopier.java 0.0 src/main/java/io/airbyte/integrations/destination/jdbc/copy/s3/S3StreamCopierFactory.java 0.0
src/main/java/io/airbyte/integrations/destination/jdbc/copy/StreamCopierFactory.java 0.0 src/main/java/io/airbyte/integrations/destination/jdbc/copy/SwitchingDestination.java 0.0
src/main/java/io/airbyte/integrations/destination/jdbc/DataAdapter.java 0.0 src/main/java/io/airbyte/integrations/destination/jdbc/JdbcBufferedConsumerFactory.java 0.0
src/main/java/io/airbyte/integrations/destination/jdbc/JdbcSqlOperations.java 0.0 src/main/java/io/airbyte/integrations/destination/jdbc/SqlOperations.java 0.0
src/main/java/io/airbyte/integrations/destination/jdbc/SqlOperationsUtils.java 0.0 src/main/java/io/airbyte/integrations/destination/jdbc/StagingFilenameGenerator.java 0.0
src/main/java/io/airbyte/integrations/destination/jdbc/WriteConfig.java 0.0

Please sign in to comment.