CloudSlang/cs-actions

View on GitHub

Showing 3,993 of 4,022 total issues

File QueryApiExecutorTest.java has 1250 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright 2019-2024 Open Text
 * This program and the accompanying materials
 * are made available under the terms of the Apache License v2.0 which accompany this distribution.
 *

    File VmServiceTest.java has 1124 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * Copyright 2019-2024 Open Text
     * This program and the accompanying materials
     * are made available under the terms of the Apache License v2.0 which accompany this distribution.
     *

      Method equals has a Cognitive Complexity of 110 (exceeds 5 allowed). Consider refactoring.
      Open

          public boolean equals(Object o) {
              if (o == this) return true;
              if (!(o instanceof SQLInputs)) return false;
              final SQLInputs other = (SQLInputs) o;
              if (!other.canEqual((Object) this)) return false;

      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

      Method getQueryParamsMap has 409 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private Map<String, String> getQueryParamsMap(String action) {
              Map<String, String> queryParamsMap = new HashMap<>();
              queryParamsMap.put("Action", action);
              queryParamsMap.put("Version", "2016-04-01");
      
      

        HttpClientInputs has 98 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class HttpClientInputs {
        
            public static final String URL = "url";
            public static final String TLS_VERSION = "tlsVersion";
            public static final String ALLOWED_CYPHERS = "allowedCyphers";

          QueryApiExecutorTest has 92 methods (exceeds 20 allowed). Consider refactoring.
          Open

          @RunWith(PowerMockRunner.class)
          @PrepareForTest({HttpClientService.class, AmazonSignatureService.class, QueryApiExecutor.class, ParamsMapBuilder.class, InputsUtil.class})
          public class QueryApiExecutorTest {
              private static final String HEADERS = "Accept:text/plain\r\n Content-Type:application/json";
              private static final String ALL_RESOURCE_TYPES = "customer-gateway,dhcp-options,image,instance,internet-gateway,network-acl,network-interface,reserved-instances,route-table,security-group,snapshot,spot-instances-request,subnet,volume,vpc,vpn-connection,vpn-gateway";

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            /*
             * Copyright 2021-2024 Open Text
             * This program and the accompanying materials
             * are made available under the terms of the Apache License v2.0 which accompany this distribution.
             *
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/DeleteGroupInput.java on lines 1..278
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/UserCommonInput.java on lines 1..278

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 837.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            /*
             * Copyright 2021-2024 Open Text
             * This program and the accompanying materials
             * are made available under the terms of the Apache License v2.0 which accompany this distribution.
             *
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/DeleteComputerAccountInput.java on lines 1..280
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/DeleteGroupInput.java on lines 1..278

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 837.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            /*
             * Copyright 2021-2024 Open Text
             * This program and the accompanying materials
             * are made available under the terms of the Apache License v2.0 which accompany this distribution.
             *
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/DeleteComputerAccountInput.java on lines 1..280
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/UserCommonInput.java on lines 1..278

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 837.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 5 locations. Consider refactoring.
            Open

            /*
             * Copyright 2021-2024 Open Text
             * This program and the accompanying materials
             * are made available under the terms of the Apache License v2.0 which accompany this distribution.
             *
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/DisableComputerAccountInput.java on lines 1..266
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/GetComputerAccountOUInput.java on lines 1..263
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/IsComputerAccountEnabledInput.java on lines 1..265
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/MoveComputerAccountToOUInput.java on lines 1..266

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 792.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 5 locations. Consider refactoring.
            Open

            /*
             * Copyright 2021-2024 Open Text
             * This program and the accompanying materials
             * are made available under the terms of the Apache License v2.0 which accompany this distribution.
             *
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/DisableComputerAccountInput.java on lines 1..266
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/EnableComputerAccountInput.java on lines 1..264
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/IsComputerAccountEnabledInput.java on lines 1..265
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/MoveComputerAccountToOUInput.java on lines 1..266

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 792.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 5 locations. Consider refactoring.
            Open

            /*
             * Copyright 2021-2024 Open Text
             * This program and the accompanying materials
             * are made available under the terms of the Apache License v2.0 which accompany this distribution.
             *
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/DisableComputerAccountInput.java on lines 1..266
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/EnableComputerAccountInput.java on lines 1..264
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/GetComputerAccountOUInput.java on lines 1..263
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/IsComputerAccountEnabledInput.java on lines 1..265

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 792.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 5 locations. Consider refactoring.
            Open

            /*
             * Copyright 2021-2024 Open Text
             * This program and the accompanying materials
             * are made available under the terms of the Apache License v2.0 which accompany this distribution.
             *
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/EnableComputerAccountInput.java on lines 1..264
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/GetComputerAccountOUInput.java on lines 1..263
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/IsComputerAccountEnabledInput.java on lines 1..265
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/MoveComputerAccountToOUInput.java on lines 1..266

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 792.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 5 locations. Consider refactoring.
            Open

            /*
             * Copyright 2021-2024 Open Text
             * This program and the accompanying materials
             * are made available under the terms of the Apache License v2.0 which accompany this distribution.
             *
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/DisableComputerAccountInput.java on lines 1..266
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/EnableComputerAccountInput.java on lines 1..264
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/GetComputerAccountOUInput.java on lines 1..263
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/MoveComputerAccountToOUInput.java on lines 1..266

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 792.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    if (!terraformWorkspaceVariableInputs.getWorkspaceVariableJson().isEmpty() & !terraformWorkspaceVariableInputs.getSensitiveWorkspaceVariableJson().isEmpty()) {
                        String sensitiveWorkspaceVariableValue;
            
                        JSONArray createWorkspaceVariableJsonArray = (JSONArray) parser.parse(terraformWorkspaceVariableInputs.getWorkspaceVariableJson());
                        JSONArray createSensitiveWorkspaceVariableJsonArray = (JSONArray) parser.parse(terraformWorkspaceVariableInputs.getSensitiveWorkspaceVariableJson());
            cs-hashicorp-terraform/src/main/java/io/cloudslang/content/hashicorp/terraform/services/VariableImpl.java on lines 81..176

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 782.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    if (!terraformVariableInputs.getVariableJson().isEmpty() & !terraformVariableInputs.getSensitiveVariableJson().isEmpty()) {
                        String sensitiveVariableValue;
            
                        JSONArray createVariableJsonArray = (JSONArray) parser.parse(terraformVariableInputs.getVariableJson());
                        JSONArray createSensitiveVariableJsonArray = (JSONArray) parser.parse(terraformVariableInputs.getSensitiveVariableJson());
            cs-hashicorp-terraform/src/main/java/io/cloudslang/content/hashicorp/terraform/services/WorkspaceVariableImpl.java on lines 78..177

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 782.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

                @Action(name = "Http Client",
                        outputs = {
                                @Output(EXCEPTION),
                                @Output(STATUS_CODE),
                                @Output(FINAL_LOCATION),

            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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            /*
             * Copyright 2021-2024 Open Text
             * This program and the accompanying materials
             * are made available under the terms of the Apache License v2.0 which accompany this distribution.
             *
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/AuthenticateUserInput.java on lines 1..254

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 745.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            /*
             * Copyright 2021-2024 Open Text
             * This program and the accompanying materials
             * are made available under the terms of the Apache License v2.0 which accompany this distribution.
             *
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/ResetComputerAccountInput.java on lines 1..253

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 745.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            /*
             * Copyright 2024 Open Text
             * This program and the accompanying materials
             * are made available under the terms of the Apache License v2.0 which accompany this distribution.
             *
            cs-oauth/src/main/java/io/cloudslang/content/oauth/entities/AuthorizationTokenInputs.java on lines 1..221
            cs-office-365/src/main/java/io/cloudslang/content/office365/entities/AuthorizationTokenInputs.java on lines 1..222

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 728.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language