CloudSlang/cs-actions

View on GitHub
cs-microfocus-dca/src/main/java/io/cloudslang/content/dca/actions/templates/DeployTemplate.java

Summary

Maintainability
C
1 day
Test Coverage

Method execute has 28 arguments (exceeds 4 allowed). Consider refactoring.
Open

            @Param(value = DCA_HOST, required = true, description = DCA_HOST_DESC) final String host,
            @Param(value = DCA_PORT, description = DCA_PORT_DESC) final String portInp,
            @Param(value = PROTOCOL, description = DCA_PROTOCOL_DESC) final String protocolInp,
            @Param(value = AUTH_TOKEN, required = true, encrypted = true, description = AUTH_TOKEN_DESC) final String authToken,
            @Param(value = REFRESH_TOKEN, encrypted = true, description = REFRESH_TOKEN_DESC) final String refreshToken,

    Method execute has 78 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @Action(name = "Deploy Template",
                description = DEPLOY_TEMPLATE_DESC,
                outputs = {
                        @Output(value = RETURN_RESULT, description = RETURN_RESULT_DESC),
                        @Output(value = RETURN_CODE, description = RETURN_CODE_DESC),

      Method execute has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          @Action(name = "Deploy Template",
                  description = DEPLOY_TEMPLATE_DESC,
                  outputs = {
                          @Output(value = RETURN_RESULT, description = RETURN_RESULT_DESC),
                          @Output(value = RETURN_CODE, description = RETURN_CODE_DESC),

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Avoid too many return statements within this method.
      Open

                      return getSuccessResultsMap(httpClientResult.get(RETURN_RESULT));

        Avoid too many return statements within this method.
        Open

                    return getFailureResultsMap(e);

          There are no issues that match your filters.

          Category
          Status