CPD Results

The following document contains the results of PMD's CPD 4.2.5.

Duplications

FileLine
cz/cuni/amis/pogamut/defcon/utils/quadtree/BuildingPlacementQuadTreeLabellingMethod.java19
cz/cuni/amis/pogamut/defcon/utils/quadtree/UnitPlacementQuadTreeLabellingMethod.java19
	public UnitPlacementQuadTreeLabellingMethod(DefConWorldView worldview,
			Logger log) {
		this.worldview = worldview;
		this.log = log;
	}

	@Override
	public boolean label(QuadTreeNode node) {

		if (node.isLabeled()) {
			if (node.getNodes() != null &&
					(node.getFirst().isLabeled() ||
							node.getSecond().isLabeled() ||
							node.getThird().isLabeled() ||
					node.getFourth().isLabeled())) {
				return true;
			}

			node.setLabel(false);

			return false;
		}

		boolean b = node.getNodes() == null && worldview.getGameInfo()
				.isValidShipPlacementLocation(
FileLine
cz/cuni/amis/pogamut/defcon/communication/worldview/NativeMapSource.java180
cz/cuni/amis/pogamut/defcon/communication/worldview/modules/grid/basic/SymmetricGridCell.java69
		if (x < -180f || x > 180f || y < -90f || y > 90f)
			return false;

		switch (flag) {
			case SEA:
				return gameInfo.isValidTerritory(-1, x, y, true);
			case LAND:
				return gameInfo.isValidTerritory(-1, x, y, false);
			case OWN_TERRITORY: {
				int id = gameInfo.getOwnTeamId();
				return gameInfo.isValidTerritory(id, x, y, false)
						|| gameInfo.isValidTerritory(id, x, y, true);
			}
			case ENEMY_TERRITORY: {
				Boolean ok = false;
				for (int id : gameInfo.getEnemyTeamIds()) {
					if (ok = gameInfo.isValidTerritory(id, x, y, false) ||