Skip to content

Commit

Permalink
formated
Browse files Browse the repository at this point in the history
  • Loading branch information
bazarnov committed Jan 19, 2022
1 parent 7ed5fa5 commit 7b50b1e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 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 @@ -39,15 +39,16 @@ public JsonNode toDatabaseConfig(final JsonNode config) {
.put("host", config.get("host").asText())
.put("username", config.get("username").asText())
.put("password", config.get("password").asText())
.put("connection_properties", String.format("role=%s;warehouse=%s;database=%s;schema=%s;JDBC_QUERY_RESULT_FORMAT=%s;CLIENT_SESSION_KEEP_ALIVE=%s;",
config.get("role").asText(),
config.get("warehouse").asText(),
config.get("database").asText(),
config.get("schema").asText(),
// Needed for JDK17 - see
// https://stackoverflow.com/questions/67409650/snowflake-jdbc-driver-internal-error-fail-to-retrieve-row-count-for-first-arrow
"JSON",
true))
.put("connection_properties",
String.format("role=%s;warehouse=%s;database=%s;schema=%s;JDBC_QUERY_RESULT_FORMAT=%s;CLIENT_SESSION_KEEP_ALIVE=%s;",
config.get("role").asText(),
config.get("warehouse").asText(),
config.get("database").asText(),
config.get("schema").asText(),
// Needed for JDK17 - see
// https://stackoverflow.com/questions/67409650/snowflake-jdbc-driver-internal-error-fail-to-retrieve-row-count-for-first-arrow
"JSON",
true))
.build());
}

Expand Down

3 comments on commit 7b50b1e

@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 Shopify(#9591)

Measures

Name Value Name Value Name Value
Duplicated Lines (%) 0.0 Security Rating A Code Smells 122
Duplicated Blocks 0 Lines of Code 796 Coverage 55.3
Quality Gate Status OK Lines to Cover 476 Reliability Rating A
Vulnerabilities 0 Bugs 0 Blocker Issues 0
Critical Issues 6 Major Issues 24 Minor Issues 170

Detected Issues

Rule File Description Message
python:mypy_misc (MINOR) source_shopify/source.py:68 Miscellaneous other checks Incompatible types in "yield" (actual type "Iterable[MutableMapping[Any, Any]]", expected type "Mapping[Any, Any]") . Code line: yield self._transformer.transform(records)
python:S5890 (MAJOR) source_shopify/source.py:158 Values assigned to variables should match their type annotations Assign to "nested_record_field_name" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_unreachable (MINOR) source_shopify/source.py:181 Warn about unreachable statements or expressions Statement is unreachable . Code line: if record.get(self.nested_substream):
python:mypy_assignment (MINOR) source_shopify/source.py:290 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "ChildSubstream" defined the type as "None") . Code line: nested_substream = "refunds"
python:mypy_index (MINOR) source_shopify/source.py:444 Check indexing operations Unsupported target for indexed assignment ("Mapping[str, Any]") . Code line: config["authenticator"] = ShopifyAuthenticator(config)
python:mypy_arg_type (MINOR) source_shopify/source.py:446 Check argument types in calls Argument 1 to "Shop" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: responce = list(Shop(config).read_records(sync_mode=None))
python:mypy_arg_type (MINOR) source_shopify/source.py:471 Check argument types in calls Argument 1 to "OrderRefunds" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: OrderRefunds(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:472 Check argument types in calls Argument 1 to "OrderRisks" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: OrderRisks(config),
python:mypy_no_untyped_def (MINOR) source_shopify/transform.py:68 Check that every function has an annotation Function is missing a return type annotation . Code line: def _transform_string(value: Any):
python:mypy_no_any_return (MINOR) source_shopify/transform.py:100 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_string(field)
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:434 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def path(self, **kwargs) -> str:
python:mypy_arg_type (MINOR) source_shopify/source.py:482 Check argument types in calls Argument 1 to "Shop" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Shop(config),
python:mypy_attr_defined (MINOR) source_shopify/source.py:110 Check that attribute exists "str" has no attribute "get" . Code line: if record.get(self.cursor_field, "") >= stream_state.g...
python:S5890 (MAJOR) source_shopify/source.py:390 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:396 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -...
python:mypy_arg_type (MINOR) source_shopify/source.py:478 Check argument types in calls Argument 1 to "InventoryItems" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: InventoryItems(config),
python:S5890 (MAJOR) source_shopify/source.py:404 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:411 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -...
python:S5890 (MAJOR) source_shopify/source.py:421 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:426 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -...
python:mypy_arg_type (MINOR) source_shopify/source.py:480 Check argument types in calls Argument 1 to "FulfillmentOrders" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: FulfillmentOrders(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:481 Check argument types in calls Argument 1 to "Fulfillments" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Fulfillments(config),
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:363 Check that every function has an annotation Function is missing a type annotation . Code line: def path(self, **kwargs):
python:S5890 (MAJOR) source_shopify/source.py:368 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:373 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -...
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:377 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def parse_response(self, response: requests.Response, **kwargs) ->...
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:380 Check that every function has an annotation Function is missing a type annotation . Code line: def generate_key(record):
python:mypy_arg_type (MINOR) source_shopify/source.py:477 Check argument types in calls Argument 1 to "Locations" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Locations(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:479 Check argument types in calls Argument 1 to "InventoryLevels" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: InventoryLevels(config),
python:mypy_index (MINOR) source_shopify/source.py:460 Check indexing operations Unsupported target for indexed assignment ("Mapping[str, Any]") . Code line: config["authenticator"] = ShopifyAuthenticator(config)
python:isort_need_format (MINOR) main.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:isort_need_format (MINOR) unit_tests/test_cached_stream_state.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:isort_need_format (MINOR) unit_tests/test_control_rate_limit.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:isort_need_format (MINOR) unit_tests/test_transform.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:isort_need_format (MINOR) unit_tests/unit_test.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:mypy_arg_type (MINOR) source_shopify/source.py:93 Check argument types in calls Argument 1 to "cache_stream_state" has incompatible type "Callable[[IncrementalShopifyStream, Optional[Mapping[str, Any]], Optional[Mapping[str, Any]], KwArg(Any)], Any]"; expected "EagerlyCachedStreamState" . Code line: @stream_state_cache.cache_stream_state
python:S5890 (MAJOR) source_shopify/source.py:156 Values assigned to variables should match their type annotations Assign to "slice_key" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:161 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def request_params(self, next_page_token: Mapping[str, Any] = None...
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:167 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def stream_slices(self, stream_state: Mapping[str, Any] = None, **...
python:mypy_operator (MINOR) source_shopify/source.py:174 Check that operator is valid for operands "object" not callable . Code line: parent_stream = self.parent_stream_class(self.config)
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:186 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def read_records(
python:S5890 (MAJOR) source_shopify/source.py:284 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:S5890 (MAJOR) source_shopify/source.py:299 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:S5890 (MAJOR) source_shopify/source.py:315 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:S5890 (MAJOR) source_shopify/source.py:342 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:105 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def stream_state_to_tmp(*args, state_object: Dict = cached_state, ...
python:mypy_attr_defined (MINOR) source_shopify/utils.py:124 Check that attribute exists "object" has no attribute "name" . Code line: state_object[stream.name] = {stream.cursor_field: current_...
python:mypy_attr_defined (MINOR) source_shopify/utils.py:124 Check that attribute exists "object" has no attribute "cursor_field" . Code line: state_object[stream.name] = {stream.cursor_field: current_...
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:134 Check that every function has an annotation Function is missing a type annotation . Code line: def decorator(*args, **kwargs):
python:mypy_misc (MINOR) source_shopify/source.py:72 Miscellaneous other checks Incompatible types in "yield" (actual type "Iterable[MutableMapping[Any, Any]]", expected type "Mapping[Any, Any]") . Code line: yield self._transformer.transform(record)
python:mypy_no_untyped_def (MINOR) source_shopify/transform.py:28 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def init(self, schema: Mapping[str, Any], **kwargs):
python:mypy_no_any_return (MINOR) source_shopify/transform.py:54 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "str" . Code line: return schema_types
python:mypy_no_untyped_def (MINOR) source_shopify/transform.py:64 Check that every function has an annotation Function is missing a return type annotation . Code line: def _transform_number(value: Any):
python:mypy_no_untyped_def (MINOR) source_shopify/transform.py:71 Check that every function has an annotation Function is missing a return type annotation . Code line: def _transform_array(self, array: List[Any], item_properties: Mapp...
python:mypy_no_untyped_def (MINOR) source_shopify/transform.py:77 Check that every function has an annotation Function is missing a return type annotation . Code line: def _transform_object(self, record: MutableMapping[str, Any], prop...
python:mypy_arg_type (MINOR) source_shopify/transform.py:95 Check argument types in calls Argument 1 to "_first_non_null_type" of "DataTypeEnforcer" has incompatible type "str"; expected "List[str]" . Code line: schema_type = self._first_non_null_type(schema_types)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:98 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_number(field)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:103 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_object(field, properties)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:106 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_array(field, properties)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:107 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return field
python:mypy_arg_type (MINOR) source_shopify/source.py:463 Check argument types in calls Argument 1 to "Customers" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Customers(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:464 Check argument types in calls Argument 1 to "Orders" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Orders(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:465 Check argument types in calls Argument 1 to "DraftOrders" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: DraftOrders(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:466 Check argument types in calls Argument 1 to "Products" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Products(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:467 Check argument types in calls Argument 1 to "AbandonedCheckouts" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: AbandonedCheckouts(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:468 Check argument types in calls Argument 1 to "Metafields" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Metafields(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:469 Check argument types in calls Argument 1 to "CustomCollections" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: CustomCollections(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:470 Check argument types in calls Argument 1 to "Collects" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Collects(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:473 Check argument types in calls Argument 1 to "Transactions" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Transactions(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:474 Check argument types in calls Argument 1 to "Pages" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Pages(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:475 Check argument types in calls Argument 1 to "PriceRules" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: PriceRules(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:476 Check argument types in calls Argument 1 to "DiscountCodes" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: DiscountCodes(config),
python:mypy_attr_defined (MINOR) source_shopify/utils.py:121 Check that attribute exists "object" has no attribute "name" . Code line: ... tmp_stream_state_value = state_object.get(stream.name, {}).get(...
python:mypy_attr_defined (MINOR) source_shopify/utils.py:121 Check that attribute exists "object" has no attribute "cursor_field" . Code line: ...te_value = state_object.get(stream.name, {}).get(stream.cursor_field, ...
python:mypy_attr_defined (MINOR) source_shopify/utils.py:127 Check that attribute exists "object" has no attribute "name" . Code line: state_object[stream.name] = {
python:mypy_attr_defined (MINOR) source_shopify/utils.py:128 Check that attribute exists "object" has no attribute "cursor_field" . Code line: stream.cursor_field: min(current_stream_state.get(...
python:S5720 (CRITICAL) source_shopify/utils.py:132 "self" should be the first argument to instance methods Rename "func" to "self" or add the missing "self" parameter.
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:132 Check that every function has an annotation Function is missing a type annotation . Code line: def cache_stream_state(func):
python:mypy_import (MINOR) source_shopify/utils.py:10 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.7) . Code line: import requests
flake8:E501 (MAJOR) source_shopify/utils.py:19 line too long (82 > 79 characters) line too long (143 > 140 characters)
flake8:E501 (MAJOR) source_shopify/utils.py:21 line too long (82 > 79 characters) line too long (147 > 140 characters)
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:30 Check that every function has an annotation Function is missing a return type annotation . Code line: def get_wait_time(*args, threshold: float = 0.9, rate_limit_header...
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:30 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def get_wait_time(*args, threshold: float = 0.9, rate_limit_header...
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:72 Check that every function has an annotation Function is missing a return type annotation . Code line: def wait_time(wait_time: float):
python:S5720 (CRITICAL) source_shopify/utils.py:75 "self" should be the first argument to instance methods Rename "threshold" to "self" or add the missing "self" parameter.
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:75 Check that every function has an annotation Function is missing a return type annotation . Code line: def balance_rate_limit(threshold: float = 0.9, rate_limit_header: ...
python:mypy_misc (MINOR) source_shopify/utils.py:75 Miscellaneous other checks Self argument missing for a non-static method (or an invalid type for self) . Code line: def balance_rate_limit(threshold: float = 0.9, rate_limit_header: ...
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:81 Check that every function has an annotation Function is missing a type annotation . Code line: def decorator(func):
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:83 Check that every function has an annotation Function is missing a type annotation . Code line: def wrapper_balance_rate_limit(*args, **kwargs):
python:S1192 (CRITICAL) unit_tests/test_control_rate_limit.py:21 String literals should not be duplicated Define a constant instead of duplicating this literal "https://test.myshopify.com/" 8 times.
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:50 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def request_params(self, next_page_token: Mapping[str, Any] = None...
python:mypy_assignment (MINOR) source_shopify/source.py:55 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", target has type "int") . Code line: params["order"] = f"{self.order_field} asc"
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:94 Check that every function has an annotation Function is missing a return type annotation . Code line: def request_params(self, stream_state: Mapping[str, Any] = None, n...
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:94 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def request_params(self, stream_state: Mapping[str, Any] = None, n...
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:129 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def request_params(
python:mypy_override (MINOR) source_shopify/source.py:129 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "ShopifyStream" . Code line: def request_params(
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:225 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def request_params(
python:mypy_override (MINOR) source_shopify/source.py:225 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "ShopifyStream" . Code line: def request_params(
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:272 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def request_params(
python:mypy_override (MINOR) source_shopify/source.py:272 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "ShopifyStream" . Code line: def request_params(
python:mypy_misc (MINOR) source_shopify/source.py:68 Miscellaneous other checks Incompatible types in "yield" (actual type "Iterable[MutableMapping[Any, Any]]", expected type "Mapping[Any, Any]") . Code line: yield self._transformer.transform(records)
python:S5890 (MAJOR) source_shopify/source.py:158 Values assigned to variables should match their type annotations Assign to "nested_record_field_name" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_unreachable (MINOR) source_shopify/source.py:181 Warn about unreachable statements or expressions Statement is unreachable . Code line: if record.get(self.nested_substream):
python:mypy_assignment (MINOR) source_shopify/source.py:290 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "ChildSubstream" defined the type as "None") . Code line: nested_substream = "refunds"
python:mypy_index (MINOR) source_shopify/source.py:444 Check indexing operations Unsupported target for indexed assignment ("Mapping[str, Any]") . Code line: config["authenticator"] = ShopifyAuthenticator(config)
python:mypy_arg_type (MINOR) source_shopify/source.py:446 Check argument types in calls Argument 1 to "Shop" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: responce = list(Shop(config).read_records(sync_mode=None))
python:mypy_arg_type (MINOR) source_shopify/source.py:471 Check argument types in calls Argument 1 to "OrderRefunds" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: OrderRefunds(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:472 Check argument types in calls Argument 1 to "OrderRisks" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: OrderRisks(config),
python:mypy_no_untyped_def (MINOR) source_shopify/transform.py:68 Check that every function has an annotation Function is missing a return type annotation . Code line: def _transform_string(value: Any):
python:mypy_no_any_return (MINOR) source_shopify/transform.py:100 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_string(field)
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:434 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def path(self, **kwargs) -> str:
python:mypy_arg_type (MINOR) source_shopify/source.py:482 Check argument types in calls Argument 1 to "Shop" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Shop(config),
python:mypy_attr_defined (MINOR) source_shopify/source.py:110 Check that attribute exists "str" has no attribute "get" . Code line: if record.get(self.cursor_field, "") >= stream_state.g...
python:S5890 (MAJOR) source_shopify/source.py:390 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:396 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -...
python:mypy_arg_type (MINOR) source_shopify/source.py:478 Check argument types in calls Argument 1 to "InventoryItems" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: InventoryItems(config),
python:S5890 (MAJOR) source_shopify/source.py:404 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:411 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -...
python:S5890 (MAJOR) source_shopify/source.py:421 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:426 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -...
python:mypy_arg_type (MINOR) source_shopify/source.py:480 Check argument types in calls Argument 1 to "FulfillmentOrders" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: FulfillmentOrders(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:481 Check argument types in calls Argument 1 to "Fulfillments" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Fulfillments(config),
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:363 Check that every function has an annotation Function is missing a type annotation . Code line: def path(self, **kwargs):
python:S5890 (MAJOR) source_shopify/source.py:368 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:373 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -...
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:377 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def parse_response(self, response: requests.Response, **kwargs) ->...
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:380 Check that every function has an annotation Function is missing a type annotation . Code line: def generate_key(record):
python:mypy_arg_type (MINOR) source_shopify/source.py:477 Check argument types in calls Argument 1 to "Locations" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Locations(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:479 Check argument types in calls Argument 1 to "InventoryLevels" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: InventoryLevels(config),
python:mypy_index (MINOR) source_shopify/source.py:460 Check indexing operations Unsupported target for indexed assignment ("Mapping[str, Any]") . Code line: config["authenticator"] = ShopifyAuthenticator(config)
python:isort_need_format (MINOR) main.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:isort_need_format (MINOR) unit_tests/test_cached_stream_state.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:isort_need_format (MINOR) unit_tests/test_control_rate_limit.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:isort_need_format (MINOR) unit_tests/test_transform.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:isort_need_format (MINOR) unit_tests/unit_test.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:mypy_arg_type (MINOR) source_shopify/source.py:93 Check argument types in calls Argument 1 to "cache_stream_state" has incompatible type "Callable[[IncrementalShopifyStream, Optional[Mapping[str, Any]], Optional[Mapping[str, Any]], KwArg(Any)], Any]"; expected "EagerlyCachedStreamState" . Code line: @stream_state_cache.cache_stream_state
python:S5890 (MAJOR) source_shopify/source.py:156 Values assigned to variables should match their type annotations Assign to "slice_key" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:161 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def request_params(self, next_page_token: Mapping[str, Any] = None...
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:167 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def stream_slices(self, stream_state: Mapping[str, Any] = None, **...
python:mypy_operator (MINOR) source_shopify/source.py:174 Check that operator is valid for operands "object" not callable . Code line: parent_stream = self.parent_stream_class(self.config)
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:186 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def read_records(
python:S5890 (MAJOR) source_shopify/source.py:284 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:S5890 (MAJOR) source_shopify/source.py:299 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:S5890 (MAJOR) source_shopify/source.py:315 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:S5890 (MAJOR) source_shopify/source.py:342 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:105 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def stream_state_to_tmp(*args, state_object: Dict = cached_state, ...
python:mypy_attr_defined (MINOR) source_shopify/utils.py:124 Check that attribute exists "object" has no attribute "name" . Code line: state_object[stream.name] = {stream.cursor_field: current_...
python:mypy_attr_defined (MINOR) source_shopify/utils.py:124 Check that attribute exists "object" has no attribute "cursor_field" . Code line: state_object[stream.name] = {stream.cursor_field: current_...
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:134 Check that every function has an annotation Function is missing a type annotation . Code line: def decorator(*args, **kwargs):
python:mypy_misc (MINOR) source_shopify/source.py:72 Miscellaneous other checks Incompatible types in "yield" (actual type "Iterable[MutableMapping[Any, Any]]", expected type "Mapping[Any, Any]") . Code line: yield self._transformer.transform(record)
python:mypy_no_untyped_def (MINOR) source_shopify/transform.py:28 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def init(self, schema: Mapping[str, Any], **kwargs):
python:mypy_no_any_return (MINOR) source_shopify/transform.py:54 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "str" . Code line: return schema_types
python:mypy_no_untyped_def (MINOR) source_shopify/transform.py:64 Check that every function has an annotation Function is missing a return type annotation . Code line: def _transform_number(value: Any):
python:mypy_no_untyped_def (MINOR) source_shopify/transform.py:71 Check that every function has an annotation Function is missing a return type annotation . Code line: def _transform_array(self, array: List[Any], item_properties: Mapp...
python:mypy_no_untyped_def (MINOR) source_shopify/transform.py:77 Check that every function has an annotation Function is missing a return type annotation . Code line: def _transform_object(self, record: MutableMapping[str, Any], prop...
python:mypy_arg_type (MINOR) source_shopify/transform.py:95 Check argument types in calls Argument 1 to "_first_non_null_type" of "DataTypeEnforcer" has incompatible type "str"; expected "List[str]" . Code line: schema_type = self._first_non_null_type(schema_types)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:98 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_number(field)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:103 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_object(field, properties)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:106 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_array(field, properties)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:107 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return field
python:mypy_arg_type (MINOR) source_shopify/source.py:463 Check argument types in calls Argument 1 to "Customers" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Customers(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:464 Check argument types in calls Argument 1 to "Orders" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Orders(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:465 Check argument types in calls Argument 1 to "DraftOrders" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: DraftOrders(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:466 Check argument types in calls Argument 1 to "Products" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Products(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:467 Check argument types in calls Argument 1 to "AbandonedCheckouts" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: AbandonedCheckouts(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:468 Check argument types in calls Argument 1 to "Metafields" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Metafields(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:469 Check argument types in calls Argument 1 to "CustomCollections" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: CustomCollections(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:470 Check argument types in calls Argument 1 to "Collects" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Collects(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:473 Check argument types in calls Argument 1 to "Transactions" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Transactions(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:474 Check argument types in calls Argument 1 to "Pages" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Pages(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:475 Check argument types in calls Argument 1 to "PriceRules" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: PriceRules(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:476 Check argument types in calls Argument 1 to "DiscountCodes" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: DiscountCodes(config),
python:mypy_attr_defined (MINOR) source_shopify/utils.py:121 Check that attribute exists "object" has no attribute "name" . Code line: ... tmp_stream_state_value = state_object.get(stream.name, {}).get(...
python:mypy_attr_defined (MINOR) source_shopify/utils.py:121 Check that attribute exists "object" has no attribute "cursor_field" . Code line: ...te_value = state_object.get(stream.name, {}).get(stream.cursor_field, ...
python:mypy_attr_defined (MINOR) source_shopify/utils.py:127 Check that attribute exists "object" has no attribute "name" . Code line: state_object[stream.name] = {
python:mypy_attr_defined (MINOR) source_shopify/utils.py:128 Check that attribute exists "object" has no attribute "cursor_field" . Code line: stream.cursor_field: min(current_stream_state.get(...
python:S5720 (CRITICAL) source_shopify/utils.py:132 "self" should be the first argument to instance methods Rename "func" to "self" or add the missing "self" parameter.
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:132 Check that every function has an annotation Function is missing a type annotation . Code line: def cache_stream_state(func):
python:mypy_import (MINOR) source_shopify/utils.py:10 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.7) . Code line: import requests
flake8:E501 (MAJOR) source_shopify/utils.py:19 line too long (82 > 79 characters) line too long (143 > 140 characters)
flake8:E501 (MAJOR) source_shopify/utils.py:21 line too long (82 > 79 characters) line too long (147 > 140 characters)
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:30 Check that every function has an annotation Function is missing a return type annotation . Code line: def get_wait_time(*args, threshold: float = 0.9, rate_limit_header...
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:30 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def get_wait_time(*args, threshold: float = 0.9, rate_limit_header...
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:72 Check that every function has an annotation Function is missing a return type annotation . Code line: def wait_time(wait_time: float):
python:S5720 (CRITICAL) source_shopify/utils.py:75 "self" should be the first argument to instance methods Rename "threshold" to "self" or add the missing "self" parameter.
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:75 Check that every function has an annotation Function is missing a return type annotation . Code line: def balance_rate_limit(threshold: float = 0.9, rate_limit_header: ...
python:mypy_misc (MINOR) source_shopify/utils.py:75 Miscellaneous other checks Self argument missing for a non-static method (or an invalid type for self) . Code line: def balance_rate_limit(threshold: float = 0.9, rate_limit_header: ...
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:81 Check that every function has an annotation Function is missing a type annotation . Code line: def decorator(func):
python:mypy_no_untyped_def (MINOR) source_shopify/utils.py:83 Check that every function has an annotation Function is missing a type annotation . Code line: def wrapper_balance_rate_limit(*args, **kwargs):
python:S1192 (CRITICAL) unit_tests/test_control_rate_limit.py:21 String literals should not be duplicated Define a constant instead of duplicating this literal "https://test.myshopify.com/" 8 times.
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:50 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def request_params(self, next_page_token: Mapping[str, Any] = None...
python:mypy_assignment (MINOR) source_shopify/source.py:55 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", target has type "int") . Code line: params["order"] = f"{self.order_field} asc"
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:94 Check that every function has an annotation Function is missing a return type annotation . Code line: def request_params(self, stream_state: Mapping[str, Any] = None, n...
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:94 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def request_params(self, stream_state: Mapping[str, Any] = None, n...
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:129 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def request_params(
python:mypy_override (MINOR) source_shopify/source.py:129 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "ShopifyStream" . Code line: def request_params(
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:225 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def request_params(
python:mypy_override (MINOR) source_shopify/source.py:225 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "ShopifyStream" . Code line: def request_params(
python:mypy_no_untyped_def (MINOR) source_shopify/source.py:272 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def request_params(
python:mypy_override (MINOR) source_shopify/source.py:272 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "ShopifyStream" . Code line: def request_params(

Coverage (55.3%)

File Coverage File Coverage
integration_tests/acceptance.py 0.0 integration_tests/integration_test.py 0.0
main.py 0.0 setup.py 0.0
source_shopify/init.py 100.0 source_shopify/auth.py 45.0
source_shopify/source.py 59.2 source_shopify/transform.py 94.8
source_shopify/utils.py 89.1 unit_tests/test_cached_stream_state.py 0.0
unit_tests/test_control_rate_limit.py 0.0 unit_tests/test_transform.py 0.0
unit_tests/unit_test.py 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 Source Snowflake(#9591)

Measures

Name Value Name Value Name Value
Coverage 0.0 Lines of Code 87 Reliability Rating A
Security Rating A Vulnerabilities 0 Duplicated Blocks 0
Duplicated Lines (%) 0.0 Code Smells 3 Bugs 0
Lines to Cover 39 Quality Gate Status OK 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 Bigquery(#9591)

Measures

Name Value Name Value Name Value
Security Rating A Quality Gate Status OK Code Smells 34
Vulnerabilities 0 Duplicated Lines (%) 0.0 Coverage 0.0
Duplicated Blocks 0 Bugs 2 Lines of Code 1194
Lines to Cover 562 Reliability Rating C 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

Please sign in to comment.