Skip to content

Commit

Permalink
Fixing squid: S1151 Switch case clauses hsould not have too many lines
Browse files Browse the repository at this point in the history
  • Loading branch information
devFozgul committed Jun 29, 2016
1 parent 468d10e commit 0bdf41f
Showing 1 changed file with 89 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2331,82 +2331,107 @@ public T next() {
final PathElement2afp elem = this.iterator.next();
switch (elem.getType()) {
case CURVE_TO:
return getGeomFactory().newCurvePathElement(
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getCtrlX1() - this.centerX, elem.getCtrlY1() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getCtrlX1() - this.centerX, elem.getCtrlY1() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getCtrlX2() - this.centerX, elem.getCtrlY2() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getCtrlX2() - this.centerX, elem.getCtrlY2() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY));
return getCurvToFromNext(elem);
case ARC_TO:
return getGeomFactory().newArcPathElement(
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY),
elem.getRadiusX(), elem.getRadiusX(), elem.getRotationX(),
elem.getLargeArcFlag(), elem.getSweepFlag());
return getArcToFromNext(elem);
case LINE_TO:
return getGeomFactory().newLinePathElement(
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY));
return getLineToFromNext(elem);
case MOVE_TO:
return getGeomFactory().newMovePathElement(
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY));
return getMoveToFromNext(elem);
case QUAD_TO:
return getGeomFactory().newCurvePathElement(
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getCtrlX1() - this.centerX, elem.getCtrlY1() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getCtrlX1() - this.centerX, elem.getCtrlY1() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY));
return getQuadToFromNext(elem);
case CLOSE:
return getGeomFactory().newClosePathElement(
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY));
return getCloseFromNext(elem);
default:
break;

}
return null;
}

private T getMoveToFromNext(PathElement2afp elem) {
return getGeomFactory().newMovePathElement(
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY));
}

private T getCurvToFromNext(PathElement2afp elem) {
return getGeomFactory().newCurvePathElement(
getGeomFactory().newCurvePathElement(
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getCtrlX1() - this.centerX, elem.getCtrlY1() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getCtrlX1() - this.centerX, elem.getCtrlY1() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getCtrlX2() - this.centerX, elem.getCtrlY2() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getCtrlX2() - this.centerX, elem.getCtrlY2() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY));
}

private T getArcToFromNext(PathElement2afp elem) {
return getGeomFactory().newArcPathElement(
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY),
elem.getRadiusX(), elem.getRadiusX(), elem.getRotationX(),
elem.getLargeArcFlag(), elem.getSweepFlag());
}

private T getLineToFromNext(PathElement2afp elem) {
return getGeomFactory().newLinePathElement(
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY));
}

private T getQuadToFromNext(PathElement2afp elem) {
return getGeomFactory().newCurvePathElement(
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getCtrlX1() - this.centerX, elem.getCtrlY1() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getCtrlX1() - this.centerX, elem.getCtrlY1() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY));
}

private T getCloseFromNext(PathElement2afp elem) {
return getGeomFactory().newClosePathElement(
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getFromX() - this.centerX, elem.getFromY() - this.centerY),
findsVectorProjectionRAxisPoint(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY),
findsVectorProjectionSAxisVector(this.axisX1, this.axisY1, this.axisX2, this.axisY2,
elem.getToX() - this.centerX, elem.getToY() - this.centerY));
}

@Override
public void remove() {
this.iterator.remove();
Expand Down

0 comments on commit 0bdf41f

Please sign in to comment.