X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pce%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fpce%2Fgraph%2FInAlgoPathValidator.java;h=c915a2772d15ce48cde8f57940148abe5f314d7a;hb=bc9a08be9d7cdeb30ecffd3c82ddd656a3a23043;hp=39ee022defd9faa8b754733422211f5532f8b39c;hpb=5e0ad32ac6d31d300babbe9f1ad367cc728d5605;p=transportpce.git diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/graph/InAlgoPathValidator.java b/pce/src/main/java/org/opendaylight/transportpce/pce/graph/InAlgoPathValidator.java index 39ee022de..c915a2772 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/graph/InAlgoPathValidator.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/graph/InAlgoPathValidator.java @@ -17,6 +17,7 @@ import org.slf4j.LoggerFactory; public class InAlgoPathValidator implements PathValidator { /* Logging. */ private static final Logger LOG = LoggerFactory.getLogger(InAlgoPathValidator.class); + private static final String IN_CHECK_PATH_DROPPED_MSG = "in checkPath dropped {} {} "; public InAlgoPathValidator() { super(); @@ -34,35 +35,38 @@ public class InAlgoPathValidator implements PathValidator return (checkTurn(partialPath.getEdgeList().get(size - 1).link().getlinkType(), edge.link().getlinkType())); } + @SuppressWarnings("java:S1541") + //sonar issue The Cyclomatic Complexity of this method "checkTurn" is 13 which is greater than 10 authorized. + //here we have clear conditional, so for the moment no need to manage this issue private boolean checkTurn(OpenroadmLinkType prevType, OpenroadmLinkType nextType) { if (nextType == OpenroadmLinkType.ADDLINK && prevType != OpenroadmLinkType.XPONDEROUTPUT) { - LOG.debug("in checkPath dropped {} {} ", prevType, nextType); + LOG.debug(IN_CHECK_PATH_DROPPED_MSG, prevType, nextType); return false; } if (nextType == OpenroadmLinkType.EXPRESSLINK && prevType != OpenroadmLinkType.ROADMTOROADM) { - LOG.debug("in checkPath dropped {} {} ", prevType, nextType); + LOG.debug(IN_CHECK_PATH_DROPPED_MSG, prevType, nextType); return false; } if (nextType == OpenroadmLinkType.DROPLINK && prevType != OpenroadmLinkType.ROADMTOROADM) { - LOG.debug("in checkPath dropped {} {} ", prevType, nextType); + LOG.debug(IN_CHECK_PATH_DROPPED_MSG, prevType, nextType); return false; } if (nextType == OpenroadmLinkType.XPONDERINPUT && prevType != OpenroadmLinkType.DROPLINK) { - LOG.debug("in checkPath dropped {} {} ", prevType, nextType); + LOG.debug(IN_CHECK_PATH_DROPPED_MSG, prevType, nextType); return false; } if (prevType == OpenroadmLinkType.EXPRESSLINK && nextType != OpenroadmLinkType.ROADMTOROADM) { - LOG.debug("in checkPath dropped {} {} ", prevType, nextType); + LOG.debug(IN_CHECK_PATH_DROPPED_MSG, prevType, nextType); return false; } if (prevType == OpenroadmLinkType.ADDLINK && nextType != OpenroadmLinkType.ROADMTOROADM) { - LOG.debug("in checkPath dropped {} {} ", prevType, nextType); + LOG.debug(IN_CHECK_PATH_DROPPED_MSG, prevType, nextType); return false; }