未验证 提交 600227d2 编写于 作者: I interactwithankush 提交者: GitHub

fix: Sonar report - fix blocker and critical ones (#1899)

* update SpatialPartitionBubbles - fix Sonar blocker issue

* fix Sonar critical issue - Define constant instead of duplicating the literal

* fix Sonar critical issue - remove unnecessary default constructor

* fix Sonar critical issue - Define constant instead of duplicating the literal

* fix Sonar critical issue - Define constant instead of duplicating the literal

* fix Sonar critical issue - Define constant instead of duplicating the literal

* fix Sonar critical issue - fix checkstyle issue

* fix Sonar critical issue - fix code smells

* fix Sonar critical issue - fix code smells

* fix Sonar critical issue - fix code smells

* fix sonarbugs - adding test cases for Commander class

* sonar fix - add assert commands in CommanderTest

* sonar fix - add test cases for CommanderTest

* sonar fix - add test cases for CommanderTest

* sonar fix - add test cases for CommanderTest

* sonar fix - add test cases for CommanderTest

* sonar fix - add test cases for CommanderTest

* sonar fix - add test cases for CommanderTest

* sonar fix - add test cases for CommanderTest

* sonar bug fix & test cases

* sonar bug fix & test cases

* sonar bug fix & test cases

* sonar bug fix & test cases

* sonar bug fix & test cases

* Revert "sonar bug fix & test cases"

This reverts commit 640dd55e35a9730e981d14665913f3d9b5b2d3b2.

* sonar bug fix & test cases

* sonar bug fix & test cases

* sonar bug fix & test cases

* sonar bug fix : avoid Thread.sleep

* sonar bug fix : cleanup Thread.sleep

* sonar bug fix: test commit

* sonar bug fix: test commit
Co-authored-by: NSubhrodip Mohanta <hello@subho.xyz>
Co-authored-by: Natayal <Ankush_Tayal@intuit.com>
上级 fee898cd
......@@ -36,9 +36,6 @@ public class Wizard {
private final Deque<Runnable> undoStack = new LinkedList<>();
private final Deque<Runnable> redoStack = new LinkedList<>();
public Wizard() {
}
/**
* Cast spell.
*/
......
......@@ -34,11 +34,11 @@ import java.util.HashMap;
public class SpatialPartitionBubbles extends SpatialPartitionGeneric<Bubble> {
private final HashMap<Integer, Bubble> bubbles;
private final QuadTree quadTree;
private final QuadTree bubblesQuadTree;
SpatialPartitionBubbles(HashMap<Integer, Bubble> bubbles, QuadTree quadTree) {
SpatialPartitionBubbles(HashMap<Integer, Bubble> bubbles, QuadTree bubblesQuadTree) {
this.bubbles = bubbles;
this.quadTree = quadTree;
this.bubblesQuadTree = bubblesQuadTree;
}
void handleCollisionsUsingQt(Bubble b) {
......@@ -46,7 +46,7 @@ public class SpatialPartitionBubbles extends SpatialPartitionGeneric<Bubble> {
// centre of bubble and length = radius of bubble
var rect = new Rect(b.coordinateX, b.coordinateY, 2D * b.radius, 2D * b.radius);
var quadTreeQueryResult = new ArrayList<Point>();
this.quadTree.query(rect, quadTreeQueryResult);
this.bubblesQuadTree.query(rect, quadTreeQueryResult);
//handling these collisions
b.handleCollision(quadTreeQueryResult, this.bubbles);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册