Skip to content

Commit

Permalink
more sonarcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
Qup42 committed Feb 7, 2025
1 parent be519ce commit 0f1ffd9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/engine/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,8 @@ Awaitable<void> Server::processUpdate(

// ____________________________________________________________________________
Awaitable<void> Server::processOperation(
auto&& operation, auto visitor, const ad_utility::Timer& requestTimer,
ad_utility::url_parser::sparqlOperation::Operation operation, auto visitor,
const ad_utility::Timer& requestTimer,
const ad_utility::httpUtils::HttpRequest auto& request, auto& send) {
auto operationString = [&operation] {

Check warning on line 921 in src/engine/Server.cpp

View check run for this annotation

Codecov / codecov/patch

src/engine/Server.cpp#L920-L921

Added lines #L920 - L921 were not covered by tests
if (auto* q = std::get_if<Query>(&operation)) {
Expand All @@ -941,8 +942,7 @@ Awaitable<void> Server::processOperation(
// of an error has been broken for some time
std::optional<PlannedQuery> plannedQuery;
try {
co_return co_await std::visit(visitor,
std::forward<decltype(operation)>(operation));
co_return co_await std::visit(visitor, std::move(operation));

Check warning on line 945 in src/engine/Server.cpp

View check run for this annotation

Codecov / codecov/patch

src/engine/Server.cpp#L945

Added line #L945 was not covered by tests
} catch (const ParseException& e) {
responseStatus = http::status::bad_request;
exceptionErrorMsg = e.errorMessageWithoutPositionalInfo();
Expand Down
3 changes: 2 additions & 1 deletion src/engine/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ class Server {
// Wraps the error handling around the processing of operations. Calls the
// visitor on the given operation.
Awaitable<void> processOperation(
auto&& operation, auto visitor, const ad_utility::Timer& requestTimer,
ad_utility::url_parser::sparqlOperation::Operation operation,
auto visitor, const ad_utility::Timer& requestTimer,
const ad_utility::httpUtils::HttpRequest auto& request, auto& send);
// Do the actual execution of a query.
Awaitable<void> processQuery(
Expand Down
6 changes: 3 additions & 3 deletions src/util/http/UrlParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ struct Update {
struct None {
bool operator==(const None& rhs) const = default;
};

using Operation = std::variant<Query, Update, None>;
} // namespace sparqlOperation

// Representation of parsed HTTP request.
Expand All @@ -78,9 +80,7 @@ struct ParsedRequest {
std::string path_;
std::optional<std::string> accessToken_;
ParamValueMap parameters_;
std::variant<sparqlOperation::Query, sparqlOperation::Update,
sparqlOperation::None>
operation_;
sparqlOperation::Operation operation_;
};

// Parse the URL path and the URL query parameters of an HTTP Request target.
Expand Down

0 comments on commit 0f1ffd9

Please sign in to comment.