Skip to content

Commit

Permalink
Update World.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
sBarnett2025 authored Oct 10, 2023
1 parent 8eff868 commit 3e99cf2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions examples/catchthecat/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,10 @@ void World::OnGui(ImGuiContext* context) {
ImVec2 pos(io.DisplaySize.x * 0.5f, io.DisplaySize.y * 0.5f);
ImGui::SetNextWindowPos(pos, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
ImGuiWindowFlags flags = ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings;
if (ImGui::Begin("Game Over", nullptr, flags)) {
if (ImGui::Button("OK", ImVec2(200, 0))) {
clearWorld();
}
}
ImGui::Begin("Game Over", nullptr, flags);
if (ImGui::Button("OK", ImVec2(200, 0)))
clearWorld();
ImGui::End();

Check notice on line 168 in examples/catchthecat/World.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (master)

✅ Getting better: Complex Method

World::OnGui decreases in cyclomatic complexity from 14 to 13, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
}
}

Expand Down

0 comments on commit 3e99cf2

Please sign in to comment.