17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-10 01:10:38 +01:00

fix: the bugs and vulnerabilities SonarCloud reports on PR #216

This commit is contained in:
2026-11-07 22:11:08 +01:00
parent 8e85def98f
commit 7667e5b2ec
65 changed files with 910 additions and 121 deletions

View File

@@ -47,7 +47,7 @@ editor_mode::selftest_result editor_mode::selftest_monkey(std::string const &com
unsigned int seed{1};
int steps{100};
words >> seed >> steps;
std::mt19937 random{seed};
std::mt19937 random{seed}; // NOSONAR: a seeded, repeatable self-test, not security-relevant
auto const pick = [&](int const Count) { return std::uniform_int_distribution<int>(0, Count - 1)(random); };
auto const within = [&](float const Low, float const High) { return std::uniform_real_distribution<float>(Low, std::max(Low + 1.0f, High))(random); };
struct area
@@ -220,7 +220,7 @@ editor_mode::selftest_result editor_mode::selftest_monkey(std::string const &com
{
unsigned int seed{1};
words >> seed;
std::mt19937 random{seed};
std::mt19937 random{seed}; // NOSONAR: a seeded, repeatable self-test, not security-relevant
std::vector<TTrack *> tracks;
for (auto *track : simulation::Paths.sequence())
if (track != nullptr && false == track->m_editorremoved && false == track->m_paths.empty())
@@ -258,7 +258,7 @@ editor_mode::selftest_result editor_mode::selftest_monkey(std::string const &com
screen_projection const projection;
auto const low{editor_ui::view_min()};
auto const high{editor_ui::view_max()};
std::shuffle(tracks.begin(), tracks.end(), random);
std::shuffle(tracks.begin(), tracks.end(), random); // NOSONAR: a seeded, repeatable self-test, not security-relevant
for (auto const *track : tracks)
{
ImVec2 at;