CloudSlang/cs-actions

View on GitHub
cs-json/src/main/java/io/cloudslang/content/json/actions/EditJson.java

Summary

Maintainability
A
3 hrs
Test Coverage

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

    @Action(name = "Edit Json",
            outputs = {
                    @Output(OutputNames.RETURN_RESULT),
                    @Output(OutputNames.RETURN_CODE),
                    @Output(OutputNames.EXCEPTION)

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

        public Map<String, String> execute(@Param(value = Constants.InputNames.JSON_OBJECT, required = true) String jsonObject,
                                           @Param(value = Constants.InputNames.JSON_PATH, required = true) String jsonPath,
                                           @Param(value = Constants.InputNames.ACTION, required = true) String action,
                                           @Param(value = Constants.InputNames.NAME) String name,
                                           @Param(value = Constants.InputNames.VALUE) String value,
    Severity: Minor
    Found in cs-json/src/main/java/io/cloudslang/content/json/actions/EditJson.java - About 45 mins to fix

      Method editJson has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private Object editJson(String jsonPath, String action, String name, Object value, JsonContext jsonContext) {
      Severity: Minor
      Found in cs-json/src/main/java/io/cloudslang/content/json/actions/EditJson.java - About 35 mins to fix

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

            @Action(name = "Edit Json",
                    outputs = {
                            @Output(OutputNames.RETURN_RESULT),
                            @Output(OutputNames.RETURN_CODE),
                            @Output(OutputNames.EXCEPTION)
        Severity: Minor
        Found in cs-json/src/main/java/io/cloudslang/content/json/actions/EditJson.java - About 35 mins to fix

        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

        There are no issues that match your filters.

        Category
        Status