CloudSlang/cs-actions

View on GitHub

Showing 2,058 of 4,022 total issues

CustomInputs has 44 methods (exceeds 20 allowed). Consider refactoring.
Open

public class CustomInputs {
    private final String operationType;
    private final String attribute;
    private final String instanceId;
    private final String imageId;

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

        @Action(name = "Send email",
                outputs = {
                        @Output(value = RETURN_RESULT, description = RETURN_RESULT_DESC),
                        @Output(value = RETURN_CODE, description = RETURN_CODE_DESC),
                        @Output(value = EXCEPTION, description = EXCEPTION_DESC),

      ClusterComputeResourceServiceTest has 44 methods (exceeds 20 allowed). Consider refactoring.
      Open

      @RunWith(PowerMockRunner.class)
      @PrepareForTest(ClusterComputeResourceService.class)
      public class ClusterComputeResourceServiceTest {
          private static final String CLUSTER_CONFIGURATION_FAILED = "Cluster configuration failed!";
          private static final String GET_CLUSTER_CONFIGURATION = "getClusterConfiguration";

        File Descriptions.java has 415 lines of code (exceeds 250 allowed). 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.
         *

          Method downloadAttachment has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

              private String downloadAttachment(Message message, String attachment, String characterSet, String path, boolean overwrite) throws Exception {
                  if (!message.isMimeType(MimeTypes.TEXT_PLAIN) && !message.isMimeType(MimeTypes.TEXT_HTML)) {
          
                      Multipart mpart = (Multipart) message.getContent();
                      File f = new File(path);

          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 createVMRequestBody has 147 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private static String createVMRequestBody(@NotNull final AzureCreateVMInputs inputs) throws Exception {
                  CreateVMRequestBody createVMRequestBody = new CreateVMRequestBody();
                  createVMRequestBody.setLocation(inputs.getAzureComputeCommonInputs().getAzureCommonInputs().getLocation());
                  createVMRequestBody.setId(SUBSCRIPTION_PATH + inputs.getAzureComputeCommonInputs().getAzureCommonInputs().getSubscriptionId() +
                          RESOURCE_GROUPS_PATH + inputs.getAzureComputeCommonInputs().getAzureCommonInputs().getResourceGroupName() + AZURE_CREATE_VM_PATH +

            InputsUtil has 42 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public final class InputsUtil {
                private static final String ACTION = "Action";
                private static final String ASSOCIATE_PUBLIC_IP_ADDRESS = "AssociatePublicIpAddress";
                private static final String CANONICAL_HEADER_CONTENT_SHA = "x-amz-content-sha256";
                private static final String GP2 = "gp2";

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

                  public Map<String, String> execute(@Param(value = HOSTNAME, required = true, description = HOSTNAME_DESC) String hostname,
                                                     @Param(value = PORT, description = PORT_DESC) String port,
                                                     @Param(value = USERNAME, required = true, description = USERNAME_DESC) String username,
                                                     @Param(value = PASSWORD, encrypted = true, required = true, description = PASSWORD_DESC) String password,
                                                     @Param(value = VM_NAME, required = true, description = VM_NAME_DESC) String vmName,

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

                    @Override
                    public boolean equals(Object o) {
                        if (this == o) {
                            return true;
                        }

                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 copyFrom has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                Open

                    private SSHOperationResult copyFrom() {
                
                        FileOutputStream fos = null;
                        try {
                
                

                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 copyFromRemoteToLocal has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected boolean copyFromRemoteToLocal(String srcPath, String destPath){
                        FileOutputStream fileOutputStream = null;
                
                        try {
                
                

                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

                File HttpClientInputs.java has 397 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*
                 * Copyright 2022-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 GetMailMessageServiceTest.java has 395 lines of code (exceeds 250 allowed). 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.
                   *

                    Function execute has 137 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                  @Param(value = PRETTY_PRINT) prettyPrintInp: String): util.Map[String, String] = {
                    
                        val proxyHostOpt = verifyEmpty(proxyHost)
                        val proxyUsernameOpt = verifyEmpty(proxyUsername)
                        val proxyPortStr = defaultIfEmpty(proxyPortInp, DEFAULT_PROXY_PORT)

                      Method setUp has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                      Open

                          @Override
                          public List<String> setUp(@NotNull final SQLInputs sqlInputs) {
                              try {
                                  final List<String> dbUrls = new ArrayList<>();
                                  // todo ask eugen if need to check class

                      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 execute has 135 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          @Action(name = CREATE_WORKSPACE_VARIABLE_OPERATION_NAME,
                                  description = CREATE_WORKSPACE_VARIABLE_DESC,
                                  outputs = {
                                          @Output(value = RETURN_RESULT, description = RETURN_RESULT_DESC),
                                          @Output(value = EXCEPTION, description = EXCEPTION_DESC),

                        Method performSFTPOperation has 135 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private void performSFTPOperation(IHasFTPOperation sftpInputs, SFTPOperation sftpOperation, SFTPCopier sftpCopier, String sessionId) throws Exception {
                                if (sftpOperation == SFTPOperation.GET) {
                                    sftpCopier.setSftpInputs(sftpInputs);
                                    try {
                                        CompletableFuture.runAsync(() -> {

                          File OsDetectorInputs.java has 391 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /*
                           * Copyright 2022-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 execute has 134 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

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

                                  @Action(name = CREATE_VARIABLE_OPERATION_NAME,
                                          description = CREATE_VARIABLE_DESC,
                                          outputs = {
                                                  @Output(value = RETURN_RESULT, description = RETURN_RESULT_DESC),
                                                  @Output(value = EXCEPTION, description = EXCEPTION_DESC),
                                Severity
                                Category
                                Status
                                Source
                                Language