CloudSlang/cs-actions

View on GitHub

Showing 3,994 of 4,023 total issues

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

  def get(httpTransport: HttpTransport, jsonFactory: JsonFactory, credential: Credential, project: String, zone: String,
          instanceName: String): Instance =

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

      def get(httpTransport: HttpTransport, jsonFactory: JsonFactory, credential: Credential, project: String, zone: String, operationName: String): Operation =

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

        def get(httpTransport: HttpTransport, jsonFactory: JsonFactory, credential: Credential, project: String, zone: String, diskName: String): Disk =

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

          def delete(httpTransport: HttpTransport, jsonFactory: JsonFactory, credential: Credential, bucketName: String,
                     metagenerationMatch: String, metagenerationNotMatch: String): Void = {

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

            def list(httpTransport: HttpTransport, jsonFactory: JsonFactory, credential: Credential, project: String, filterOpt: Option[String],
                     orderByOpt: Option[String]): List[Network] = {

            Function createBucket has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              def createBucket(bucketName: String, location: String, locationType: String, storageClass: String,
                               accessControlType: String, retentionPeriodType: String, retentionPeriod: String,
                               isVersioningEnabled: String, labels: java.util.Map[String, String],
                               isDefaultEventBasedHoldEnabled: String): Bucket = {
            
            

            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

            Identical blocks of code found in 4 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-hashicorp-terraform/src/main/java/io/cloudslang/content/hashicorp/terraform/actions/utils/Counter.java on lines 1..49
            cs-nutanix-prism/src/main/java/io/cloudslang/content/nutanix/prism/actions/utils/Counter.java on lines 1..52
            cs-oracle-cloud/src/main/java/io/cloudslang/content/oracle/oci/actions/utils/Counter.java on lines 1..47

            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 55.

            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

            Identical blocks of code found in 4 locations. Consider refactoring.
            Open

            
            package io.cloudslang.content.nutanix.prism.actions.utils;
            
            import com.hp.oo.sdk.content.annotations.Action;
            import com.hp.oo.sdk.content.annotations.Output;
            cs-azure/src/main/java/io/cloudslang/content/azure/actions/utils/Counter.java on lines 1..65
            cs-hashicorp-terraform/src/main/java/io/cloudslang/content/hashicorp/terraform/actions/utils/Counter.java on lines 1..49
            cs-oracle-cloud/src/main/java/io/cloudslang/content/oracle/oci/actions/utils/Counter.java on lines 1..47

            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 55.

            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

            Identical blocks of code found in 4 locations. Consider refactoring.
            Open

            
            package io.cloudslang.content.hashicorp.terraform.actions.utils;
            
            import com.hp.oo.sdk.content.annotations.Action;
            import com.hp.oo.sdk.content.annotations.Output;
            cs-azure/src/main/java/io/cloudslang/content/azure/actions/utils/Counter.java on lines 1..65
            cs-nutanix-prism/src/main/java/io/cloudslang/content/nutanix/prism/actions/utils/Counter.java on lines 1..52
            cs-oracle-cloud/src/main/java/io/cloudslang/content/oracle/oci/actions/utils/Counter.java on lines 1..47

            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 55.

            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

            Identical blocks of code found in 4 locations. Consider refactoring.
            Open

            package io.cloudslang.content.oracle.oci.actions.utils;
            
            import com.hp.oo.sdk.content.annotations.Action;
            import com.hp.oo.sdk.content.annotations.Output;
            import com.hp.oo.sdk.content.annotations.Param;
            cs-azure/src/main/java/io/cloudslang/content/azure/actions/utils/Counter.java on lines 1..65
            cs-hashicorp-terraform/src/main/java/io/cloudslang/content/hashicorp/terraform/actions/utils/Counter.java on lines 1..49
            cs-nutanix-prism/src/main/java/io/cloudslang/content/nutanix/prism/actions/utils/Counter.java on lines 1..52

            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 55.

            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

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

                public static class Builder {
                    private HttpClientInputs httpClientInputs;
                    private CommonInputs commonInputs;
            
                    public InputsWrapper build() {
            cs-dropbox/src/main/java/io/cloudslang/content/dropbox/entities/inputs/InputsWrapper.java on lines 53..70

            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 55.

            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

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

                private boolean addSecurityProvider() {
                    boolean providerAdded = false;
                    Provider provider = Security.getProvider("BC");
                    if (provider == null) {
                        providerAdded = true;
            cs-ssh/src/main/java/io/cloudslang/content/ssh/services/actions/SSHShellAbstract.java on lines 46..54

            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 55.

            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

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

                public static class Builder {
                    private HttpClientInputs httpClientInputs;
                    private CommonInputs commonInputs;
            
                    public InputsWrapper build() {
            cs-couchbase/src/main/java/io/cloudslang/content/couchbase/entities/inputs/InputsWrapper.java on lines 72..89

            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 55.

            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

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

                protected boolean addSecurityProvider() {
                    boolean providerAdded = false;
                    Provider provider = Security.getProvider("BC");
                    if (provider == null) {
                        providerAdded = true;
            cs-rft/src/main/java/io/cloudslang/content/rft/services/SFTPService.java on lines 266..274

            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 55.

            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

                @Test
                public void validateSqlQueryLOBInputsValid() throws Exception {
                    final List<String> validationList = validateSqlQueryLOBInputs("1", MSSQL_DB_TYPE, "username",
                            "Password", "someInstance", "123", "database", AUTH_SQL, "Command", "true", EMPTY, EMPTY, "1", TYPE_FORWARD_ONLY, CONCUR_READ_ONLY, EMPTY);
                    assertThat(validationList, is(Collections.<String>emptyList()));
            cs-database/src/test/java/io/cloudslang/content/database/utils/SQLInputsValidatorTest.java on lines 92..98
            cs-database/src/test/java/io/cloudslang/content/database/utils/SQLInputsValidatorTest.java on lines 128..134

            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 55.

            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

                @Test
                public void validateSqlQueryTabularInputsValid() throws Exception {
                    final List<String> validationList = validateSqlQueryTabularInputs("1", MSSQL_DB_TYPE, "username",
                            "Password", "someInstance", "123", "database", AUTH_SQL, "Command", "true", EMPTY, EMPTY,
                            "1", TYPE_FORWARD_ONLY, CONCUR_READ_ONLY, EMPTY);
            cs-database/src/test/java/io/cloudslang/content/database/utils/SQLInputsValidatorTest.java on lines 92..98
            cs-database/src/test/java/io/cloudslang/content/database/utils/SQLInputsValidatorTest.java on lines 113..118

            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 55.

            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

                @Test
                public void validateSqlQueryAllRowsInputsValid() throws Exception {
                    final List<String> validationList = validateSqlQueryAllRowsInputs("1", MSSQL_DB_TYPE, "username",
                            "Password", "someInstance", "123", "database", AUTH_SQL, "Command", "true", EMPTY, EMPTY,
                            "1", TYPE_FORWARD_ONLY, CONCUR_READ_ONLY, EMPTY);
            cs-database/src/test/java/io/cloudslang/content/database/utils/SQLInputsValidatorTest.java on lines 113..118
            cs-database/src/test/java/io/cloudslang/content/database/utils/SQLInputsValidatorTest.java on lines 128..134

            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 55.

            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

                @Test
                public void testRemoveSecurityProvider() {
                    SSHShellAbstract sshShellAbstract = new SSHShellAbstract() {
                    };
                    boolean securityProviderAdded = sshShellAbstract.addSecurityProvider();
            cs-ssh/src/test/java/io/cloudslang/content/ssh/services/actions/SSHShellAbstractTest.java on lines 66..76

            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 55.

            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

                @Test
                public void testAddSecurityProvider() {
                    SSHShellAbstract sshShellAbstract = new SSHShellAbstract() {
                    };
                    boolean securityProviderAdded = sshShellAbstract.addSecurityProvider();
            cs-ssh/src/test/java/io/cloudslang/content/ssh/services/actions/SSHShellAbstractTest.java on lines 78..88

            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 55.

            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 6 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/ComputerAccountInterface.java on lines 1..56
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/DeleteComputerInterface.java on lines 1..56
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/GetCompAccountOUInput.java on lines 1..54
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/MoveCompAccountToOUInput.java on lines 1..55
            cs-active-directory/src/main/java/io/cloudslang/content/active_directory/entities/ResetUserPassInput.java on lines 1..55

            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 54.

            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