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\modules\grid\basic\SymmetricGridCell.java69
cz\cuni\amis\pogamut\defcon\communication\worldview\NativeMapSource.java180
		if (x < -X_SPAN || x > X_SPAN || y < -Y_SPAN || y > Y_SPAN)
			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 = hasEnemyTerritoryFlagWorker(x, y, id))