Skip to content

Commit 43a3f7c

Browse files
authored
Solve some open sonarqube issues (#76)
* Fix some sonarqube issues * Add sonarlint connected mode config
1 parent 33f6a08 commit 43a3f7c

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

.sonarlint/connectedMode.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sonarCloudOrganization": "x-rays5",
3+
"projectKey": "X-rays5_gta_base",
4+
"region": "EU"
5+
}

common/src/conversion/hex.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ namespace base::common::conversion {
99
if (!addr)
1010
return "0x0";
1111

12-
std::ostringstream stream;
13-
stream << "0x" << std::hex << std::uppercase << addr;
14-
return stream.str();
12+
return std::format("0x{:X}", addr);
1513
}
1614

1715
struct HexToIntTable {

common/src/globals.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
#define GLOBALS_HPP_02231200
77

88
namespace base::common::globals {
9-
constexpr static auto kBASE_NAME = "base";
10-
constexpr static auto target_window_name = "";
11-
constexpr static auto target_window_class = "grcWindow";
12-
constexpr static auto target_process_name = "GTA5.exe";
9+
constexpr static auto* kBASE_NAME = "base";
10+
constexpr static auto* target_window_name = "";
11+
constexpr static auto* target_window_class = "grcWindow";
12+
constexpr static auto* target_process_name = "GTA5.exe";
1313
}
1414

1515
#endif //GLOBALS_HPP_02231200

common/src/logging/logger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ namespace base::common::logging {
9090
formatter->add_flag<ThreadIdFormatter>('N').set_pattern("[%T] [%^%l%$] [thread: %N] [%s:%#] %v");
9191
spdlog::set_formatter(std::move(formatter));
9292

93-
logger->set_error_handler([&](const std::string& err) {
93+
logger->set_error_handler([&logger](const std::string& err) {
9494
logger->critical("spdlog: {}", err);
9595
});
9696

injector/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void DoFrame(const base::injector::Window& window) {
4848
ImGui::Text(!game_wnd ? "Game not running" : fmt::format("Game running: {}", base::win32::GetPIDFromHWND(game_wnd).value_or(0)).c_str());
4949
if (game_wnd) {
5050
if (ImGui::Button("Inject")) {
51-
auto _ = std::async(std::launch::async, [=]() {
51+
auto _ = std::async(std::launch::async, [game_wnd]() {
5252
if (const auto res = base::injector::Inject(base::win32::GetPIDFromHWND(game_wnd).value_or(0), kSETTINGS.dll_path); res.error()) {
5353
LOG_ERROR("Failed to inject: {}", res.error());
5454
MessageBoxA(nullptr, res.error().GetResultMessage().c_str(), "Error", MB_OK | MB_ICONERROR);

menu/src/memory/signature/batch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace base::menu::memory::signature {
3838

3939
std::vector<std::future<bool>> futures;
4040
for (auto&& job : std::views::values(patterns_)) {
41-
futures.emplace_back(util::kTHREAD_POOL->emplace_back([&] {
41+
futures.emplace_back(util::kTHREAD_POOL->emplace_back([&profile, &job]() {
4242
profile.Begin(job.name);
4343
const auto res = ScanPattern(job);
4444
profile.End(job.name);

0 commit comments

Comments
 (0)