CloudSlang/cs-actions

View on GitHub
cs-sharepoint/src/main/java/io/cloudslang/content/sharepoint/utils/InputsValidation.java

Summary

Maintainability
C
7 hrs
Test Coverage

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

    public static List<String> verifyAuthorizationInputs(@Nullable final String loginType, @Nullable final String clientId, @Nullable final String clientSecret, @Nullable final String username, @Nullable final String password, @NotNull final String proxyPort) {

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

        public static List<String> verifyCommonInputs(@Nullable final String proxyPort,
                                                      @Nullable final String trustAllRoots,
                                                      @Nullable final String x509HostnameVerifier,
                                                      @Nullable final String connectTimeout,
                                                      @Nullable final String socketTimeout) {

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

          @NotNull
          public static List<String> verifyAuthorizationInputs(@Nullable final String loginType, @Nullable final String clientId, @Nullable final String clientSecret, @Nullable final String username, @Nullable final String password, @NotNull final String proxyPort) {
              final List<String> exceptionMessages = new ArrayList<>();
              addVerifyLoginType(exceptionMessages, loginType, LOGIN_TYPE);
              addVerifyNotNullOrEmpty(exceptionMessages, clientId, CLIENT_ID);
      cs-microsoft-ad/src/main/java/io/cloudslang/content/microsoftAD/utils/InputsValidation.java on lines 42..61
      cs-oauth/src/main/java/io/cloudslang/content/oauth/utils/InputsValidation.java on lines 34..48
      cs-office-365/src/main/java/io/cloudslang/content/office365/utils/InputsValidation.java on lines 46..60

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

      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

          @NotNull
          public static List<String> verifyCommonInputs(@Nullable final String proxyPort,
                                                        @Nullable final String trustAllRoots,
                                                        @Nullable final String x509HostnameVerifier,
                                                        @Nullable final String connectTimeout,
      cs-excel/src/main/java/io/cloudslang/content/excel/utils/InputsValidation.java on lines 55..70
      cs-excel/src/main/java/io/cloudslang/content/excel/utils/InputsValidation.java on lines 117..132
      cs-oracle-cloud-databases/src/main/java/io/cloudslang/content/database/utils/InputsValidation.java on lines 46..63
      cs-oracle-cloud-databases/src/main/java/io/cloudslang/content/database/utils/InputsValidation.java on lines 89..106

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

      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 9 locations. Consider refactoring.
      Open

          @NotNull
          private static List<String> addVerifyNumber(@NotNull List<String> exceptions, @Nullable final String input, @NotNull final String inputName) {
              if (isEmpty(input)) {
                  exceptions.add(String.format(EXCEPTION_NULL_EMPTY, inputName));
              } else if (!NumberUtilities.isValidInt(input)) {
      cs-hashicorp-terraform/src/main/java/io/cloudslang/content/hashicorp/terraform/utils/InputsValidation.java on lines 275..284
      cs-httpclient-commons/src/main/java/io/cloudslang/content/httpclient/utils/InputsValidator.java on lines 142..150
      cs-microfocus-sitescope/src/main/java/io/cloudslang/content/sitescope/utils/InputsValidation.java on lines 160..168
      cs-microsoft-ad/src/main/java/io/cloudslang/content/microsoftAD/utils/InputsValidation.java on lines 356..366
      cs-nutanix-prism/src/main/java/io/cloudslang/content/nutanix/prism/utils/InputsValidation.java on lines 88..97
      cs-office-365/src/main/java/io/cloudslang/content/office365/utils/InputsValidation.java on lines 342..350
      cs-oracle-cloud/src/main/java/io/cloudslang/content/oracle/oci/utils/InputsValidation.java on lines 74..83
      cs-winrm/src/main/java/io/cloudslang/content/winrm/utils/InputsValidation.java on lines 133..141

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

      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 12 locations. Consider refactoring.
      Open

          @NotNull
          public static List<String> addVerifyBoolean(@NotNull List<String> exceptions, @Nullable final String input, @NotNull final String inputName) {
              if (isEmpty(input)) {
                  exceptions.add(String.format(EXCEPTION_NULL_EMPTY, inputName));
              } else if (!isValid(input)) {
      cs-azure/src/main/java/io/cloudslang/content/azure/utils/InputsValidation.java on lines 116..125
      cs-excel/src/main/java/io/cloudslang/content/excel/utils/InputsValidation.java on lines 149..157
      cs-hashicorp-terraform/src/main/java/io/cloudslang/content/hashicorp/terraform/utils/InputsValidation.java on lines 251..260
      cs-httpclient-commons/src/main/java/io/cloudslang/content/httpclient/utils/InputsValidator.java on lines 132..140
      cs-microfocus-sitescope/src/main/java/io/cloudslang/content/sitescope/utils/InputsValidation.java on lines 138..146
      cs-nutanix-prism/src/main/java/io/cloudslang/content/nutanix/prism/utils/InputsValidation.java on lines 64..73
      cs-office-365/src/main/java/io/cloudslang/content/office365/utils/InputsValidation.java on lines 332..340
      cs-oracle-cloud/src/main/java/io/cloudslang/content/oracle/oci/utils/InputsValidation.java on lines 63..72
      cs-tesseract/src/main/java/io/cloudslang/content/tesseract/utils/InputsValidation.java on lines 114..122
      cs-winrm/src/main/java/io/cloudslang/content/winrm/utils/InputsValidation.java on lines 113..121
      cs-winrm/src/main/java/io/cloudslang/content/winrm/utils/InputsValidation.java on lines 123..131

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

      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 8 locations. Consider refactoring.
      Open

          @NotNull
          private static List<String> addVerifyProxy(@NotNull List<String> exceptions, @Nullable final String input, @NotNull final String inputName) {
              if (isEmpty(input)) {
                  exceptions.add(String.format(EXCEPTION_NULL_EMPTY, inputName));
              } else if (!isValidIpPort(input)) {
      cs-hashicorp-terraform/src/main/java/io/cloudslang/content/hashicorp/terraform/utils/InputsValidation.java on lines 231..240
      cs-microfocus-sitescope/src/main/java/io/cloudslang/content/sitescope/utils/InputsValidation.java on lines 128..136
      cs-microsoft-ad/src/main/java/io/cloudslang/content/microsoftAD/utils/InputsValidation.java on lines 333..343
      cs-nutanix-prism/src/main/java/io/cloudslang/content/nutanix/prism/utils/InputsValidation.java on lines 44..53
      cs-oauth/src/main/java/io/cloudslang/content/oauth/utils/InputsValidation.java on lines 66..74
      cs-office-365/src/main/java/io/cloudslang/content/office365/utils/InputsValidation.java on lines 322..330
      cs-oracle-cloud/src/main/java/io/cloudslang/content/oracle/oci/utils/InputsValidation.java on lines 52..61

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

      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

          @NotNull
          private static List<String> addVerifyLoginType(@NotNull List<String> exceptions, @Nullable final String input, @NotNull final String inputName) {
              if (!(StringUtilities.equalsIgnoreCase(input, API) || StringUtilities.equalsIgnoreCase(input, NATIVE))) {
                  exceptions.add(String.format(EXCEPTION_INVALID_LOGIN_TYPE, inputName));
              }
      cs-microsoft-ad/src/main/java/io/cloudslang/content/microsoftAD/utils/InputsValidation.java on lines 313..321
      cs-oauth/src/main/java/io/cloudslang/content/oauth/utils/InputsValidation.java on lines 50..56
      cs-office-365/src/main/java/io/cloudslang/content/office365/utils/InputsValidation.java on lines 294..300

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

      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

      There are no issues that match your filters.

      Category
      Status