CloudSlang/cs-actions

View on GitHub

Showing 3,994 of 4,023 total issues

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

    public Map<String, String> getDeleteLoadBalancerQueryParamsMap(InputsWrapper wrapper) {
        Map<String, String> queryParamsMap = new HashMap<>();
        setCommonQueryParamsMap(queryParamsMap, wrapper.getCommonInputs().getAction(), wrapper.getCommonInputs().getVersion());
        queryParamsMap.put(LOAD_BALANCER_ARN, wrapper.getLoadBalancerInputs().getLoadBalancerArn());

cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/ElasticIpUtils.java on lines 55..61
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/ImageUtils.java on lines 88..94
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 179..186
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 188..195
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 197..204
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/SnapshotUtils.java on lines 63..69
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/VolumeUtils.java on lines 95..101

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

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

    public Map<String, String> getDeleteSnapshotQueryParamsMap(InputsWrapper wrapper) {
        Map<String, String> queryParamsMap = new HashMap<>();
        setCommonQueryParamsMap(queryParamsMap, wrapper.getCommonInputs().getAction(), wrapper.getCommonInputs().getVersion());
        queryParamsMap.put(SNAPSHOT_ID, wrapper.getVolumeInputs().getSnapshotId());

cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/ElasticIpUtils.java on lines 55..61
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/ImageUtils.java on lines 88..94
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/LoadBalancingUtils.java on lines 110..116
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 179..186
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 188..195
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 197..204
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/VolumeUtils.java on lines 95..101

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

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

    public Map<String, String> getDeleteVolumeQueryParamsMap(InputsWrapper wrapper) {
        Map<String, String> queryParamsMap = new HashMap<>();
        setCommonQueryParamsMap(queryParamsMap, wrapper.getCommonInputs().getAction(), wrapper.getCommonInputs().getVersion());
        queryParamsMap.put(VOLUME_ID, wrapper.getCustomInputs().getVolumeId());

cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/ElasticIpUtils.java on lines 55..61
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/ImageUtils.java on lines 88..94
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/LoadBalancingUtils.java on lines 110..116
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 179..186
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 188..195
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 197..204
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/SnapshotUtils.java on lines 63..69

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

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

    public Map<String, String> getAllocateAddressQueryParamsMap(InputsWrapper wrapper) {
        Map<String, String> queryParamsMap = new HashMap<>();
        setCommonQueryParamsMap(queryParamsMap, wrapper.getCommonInputs().getAction(), wrapper.getCommonInputs().getVersion());
        queryParamsMap.put(DOMAIN, wrapper.getCustomInputs().getDomain());

cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/ImageUtils.java on lines 88..94
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/LoadBalancingUtils.java on lines 110..116
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 179..186
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 188..195
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 197..204
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/SnapshotUtils.java on lines 63..69
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/VolumeUtils.java on lines 95..101

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

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
    public Map<String, String> getDeleteSubnetQueryParamsMap(@NotNull InputsWrapper wrapper) {
        Map<String, String> queryParamsMap = new HashMap<>();
        setCommonQueryParamsMap(queryParamsMap, wrapper.getCommonInputs().getAction(), wrapper.getCommonInputs().getVersion());
        queryParamsMap.put(SUBNET_ID, wrapper.getCustomInputs().getSubnetId());
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/ElasticIpUtils.java on lines 55..61
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/ImageUtils.java on lines 88..94
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/LoadBalancingUtils.java on lines 110..116
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 179..186
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 197..204
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/SnapshotUtils.java on lines 63..69
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/VolumeUtils.java on lines 95..101

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

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
    public Map<String, String> getDeleteVpcQueryParamsMap(@NotNull InputsWrapper wrapper) {
        Map<String, String> queryParamsMap = new HashMap<>();
        setCommonQueryParamsMap(queryParamsMap, wrapper.getCommonInputs().getAction(), wrapper.getCommonInputs().getVersion());
        queryParamsMap.put(VPC_ID, wrapper.getCustomInputs().getVpcId());
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/ElasticIpUtils.java on lines 55..61
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/ImageUtils.java on lines 88..94
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/LoadBalancingUtils.java on lines 110..116
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 179..186
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/NetworkUtils.java on lines 188..195
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/SnapshotUtils.java on lines 63..69
cs-amazon/src/main/java/io/cloudslang/content/amazon/factory/helpers/VolumeUtils.java on lines 95..101

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

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

            if (statusCode >= 200 && statusCode < 300) {
                results.put(INSTANCE_NAME, JsonPath.read(returnMessage, INSTANCE_NAME_JSON_PATH));

            } else {
                return HttpUtils.getFailureResults(instanceId, statusCode, returnMessage);
cs-oracle-cloud/src/main/java/io/cloudslang/content/oracle/oci/actions/volumes/GetVolumeAttachmentDetails.java on lines 119..123

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

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

            if (statusCode >= 200 && statusCode < 300) {
                results.put(VOLUME_ATTACHMENT_STATE, JsonPath.read(returnMessage, VOLUME_ATTACHMENT_LIFECYCLE_STATE_JSON_PATH));
            } else {
                return HttpUtils.getFailureResults(volumeAttachmentId, statusCode, returnMessage);
            }
cs-oracle-cloud/src/main/java/io/cloudslang/content/oracle/oci/actions/instances/UpdateInstance.java on lines 138..143

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

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

        }catch(Exception e)
        {
            Map<String, String> result = new HashMap<>();
            result.put(STATUS_CODE, EMPTY);
            result.put(RETURN_RESULT, INVALID_JSON_INPUT_DESC);
cs-microsoft-ad/src/main/java/io/cloudslang/content/microsoftAD/services/AssignRemoveUserLicenseService.java on lines 88..95

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

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

        }catch(Exception e)
        {
            Map<String, String> result = new HashMap<>();
            result.put(STATUS_CODE, EMPTY);
            result.put(RETURN_RESULT, INVALID_STRING_ARRAY_INPUT_DESC);
cs-microsoft-ad/src/main/java/io/cloudslang/content/microsoftAD/services/AssignRemoveUserLicenseService.java on lines 61..68

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

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

            try {
                double valueNumeric = Double.parseDouble(tmp[i].trim());
                cell.setCellValue(valueNumeric);
            }
            //for non-numeric value
cs-excel/src/main/java/io/cloudslang/content/excel/services/AddCellService.java on lines 231..238

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

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

                try {
                    double value_num = Double.parseDouble(tmpCol[j].trim());
                    cell.setCellValue(value_num);
                }
                //for non-numeric value
cs-excel/src/main/java/io/cloudslang/content/excel/services/AddCellService.java on lines 264..271

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

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

    private void testInvalidLong(String value) {
        try {
            NumberUtilities.toLong(value);
            assertFalse(true);
        } catch (IllegalArgumentException iae) {
cs-commons/src/test/java/io/cloudslang/content/utils/NumberUtilitiesTest.java on lines 69..76
cs-commons/src/test/java/io/cloudslang/content/utils/NumberUtilitiesTest.java on lines 129..136

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

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

        inputBuilder.hostname(SMTP_HOSTANME)
                .port(PORT)
                .from(FROM)
                .to(TO)
                .cc(CC)
cs-mail/src/test/java/io/cloudslang/content/mail/services/SendMailServiceTest.java on lines 393..403
cs-mail/src/test/java/io/cloudslang/content/mail/services/SendMailServiceTest.java on lines 434..444

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

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

    private void testInvalidInteger(String value) {
        try {
            NumberUtilities.toInteger(value);
            assertFalse(true);
        } catch (IllegalArgumentException iae) {
cs-commons/src/test/java/io/cloudslang/content/utils/NumberUtilitiesTest.java on lines 129..136
cs-commons/src/test/java/io/cloudslang/content/utils/NumberUtilitiesTest.java on lines 183..190

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

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

    public String trimIntList(String str_list, String delimiter, int percent) throws Exception {
        int[] list = ListProcessor.toIntArray(str_list, delimiter);
        list = ListProcessor.trimPercent(ListProcessor.sort(list), percent);
        return ListProcessor.toString(list, delimiter);
    }
cs-lists/src/main/java/io/cloudslang/content/actions/ListTrimAction.java on lines 112..116
cs-lists/src/main/java/io/cloudslang/content/actions/ListTrimAction.java on lines 118..122

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

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

    public String trimDoubleList(String str_list, String delimiter, int percent) throws Exception {
        double[] list = ListProcessor.toDoubleArray(str_list, delimiter);
        list = ListProcessor.trimPercent(ListProcessor.sort(list), percent);
        return ListProcessor.toString(list, delimiter);
    }
cs-lists/src/main/java/io/cloudslang/content/actions/ListTrimAction.java on lines 106..110
cs-lists/src/main/java/io/cloudslang/content/actions/ListTrimAction.java on lines 118..122

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

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

    private void testInvalidDouble(String value) {
        try {
            NumberUtilities.toDouble(value);
            assertFalse(true);
        } catch (IllegalArgumentException iae) {
cs-commons/src/test/java/io/cloudslang/content/utils/NumberUtilitiesTest.java on lines 69..76
cs-commons/src/test/java/io/cloudslang/content/utils/NumberUtilitiesTest.java on lines 183..190

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

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

    public String trimStringList(String str_list, String delimiter, int percent) throws Exception {
        String[] list = ListProcessor.toArray(str_list, delimiter);
        list = ListProcessor.trimPercent(ListProcessor.sort(list), percent);
        return ListProcessor.toString(list, delimiter);
    }
cs-lists/src/main/java/io/cloudslang/content/actions/ListTrimAction.java on lines 106..110
cs-lists/src/main/java/io/cloudslang/content/actions/ListTrimAction.java on lines 112..116

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

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

        inputBuilder.hostname(SMTP_HOSTANME)
                .port(PORT)
                .from(FROM)
                .to(TO)
                .cc(CC)
cs-mail/src/test/java/io/cloudslang/content/mail/services/SendMailServiceTest.java on lines 232..242
cs-mail/src/test/java/io/cloudslang/content/mail/services/SendMailServiceTest.java on lines 434..444

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

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