CloudSlang/cs-actions

View on GitHub
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java

Summary

Maintainability
C
1 day
Test Coverage

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

    @Test
    public void testInvalidArray2() throws Exception {
        String array1 = "[1,2,3]";
        String array2 = "[dfgs][!@##$%^&*";
        final Map<String, String> returnResult = mergeArrays.execute(array1, array2);
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 99..107

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

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 testInvalidArray1() throws Exception {
        String array1 = "[dfgs][!@##$%^&*";
        String array2 = "[1,2,3]";
        final Map<String, String> returnResult = mergeArrays.execute(array1, array2);
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 109..117

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

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 testEmptyArray2() throws Exception {
        String array1 = "[1,2,3]";
        String array2 = "";
        final Map<String, String> returnResult = mergeArrays.execute(array1, array2);
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 61..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 69.

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 testEmptyArray1() throws Exception {
        String array1 = "";
        String array2 = "[1,2,3]";
        final Map<String, String> returnResult = mergeArrays.execute(array1, array2);
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 80..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 69.

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 testMergeEmptyArray2() throws Exception {
        String array1 = "[1,2,3]";
        String array2 = "[]";
        final Map<String, String> returnResult = mergeArrays.execute(array1, array2);
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 119..126
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 137..144

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

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 testMergeEmptyBothArrays() throws Exception {
        String array1 = "[]";
        String array2 = "[]";
        final Map<String, String> returnResult = mergeArrays.execute(array1, array2);
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 119..126
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 128..135

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

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 testMergeEmptyArray1() throws Exception {
        String array1 = "[]";
        String array2 = "[1,2,3]";
        final Map<String, String> returnResult = mergeArrays.execute(array1, array2);
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 128..135
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 137..144

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

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

    @Test
    public void testSimpleStringArray() throws Exception {
        String array1 = "[\"one\",\"two\",\"three\"]";
        String array2 = "[\"one\",\"two\",\"three\"]";
        final Map<String, String> returnResult = mergeArrays.execute(array1, array2);
cs-json/src/test/java/io/cloudslang/content/json/actions/GetValueFromObjectTest.java on lines 196..202
cs-json/src/test/java/io/cloudslang/content/json/actions/GetValueFromObjectTest.java on lines 204..210
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 37..43
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 45..51

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

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

    @Test
    public void testSimpleIntegerArray() throws Exception {
        String array1 = "[1,2,3]";
        String array2 = "[1,2,3]";
        final Map<String, String> returnResult = mergeArrays.execute(array1, array2);
cs-json/src/test/java/io/cloudslang/content/json/actions/GetValueFromObjectTest.java on lines 196..202
cs-json/src/test/java/io/cloudslang/content/json/actions/GetValueFromObjectTest.java on lines 204..210
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 37..43
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 53..59

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

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

    @Test
    public void testArrayWithJsonInside() throws Exception {
        String array1 = " [{\"one\":1, \"two\":2}, 3, \"four\"]";
        String array2 = "[{\"one\":1, \"two\":2}, 3, \"four\"]";
        final Map<String, String> returnResult = mergeArrays.execute(array1, array2);
cs-json/src/test/java/io/cloudslang/content/json/actions/GetValueFromObjectTest.java on lines 196..202
cs-json/src/test/java/io/cloudslang/content/json/actions/GetValueFromObjectTest.java on lines 204..210
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 45..51
cs-json/src/test/java/io/cloudslang/content/json/actions/MergeArraysTest.java on lines 53..59

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

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