CloudSlang/cs-actions

View on GitHub

Showing 3,994 of 4,023 total issues

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

    @Test
    public void testAddActionEmpty() throws Exception {
        final String jsonPathQuery = "$.arrayTest";
        final Map<String, String> result = editJson.execute(jsonFile, jsonPathQuery, "add", "", "", VALIDATE_VALUE_FALSE);
        assertEquals("{\"store\":{\"book\":[{\"category\":\"reference\",\"author\":\"Nigel Rees\",\"title\":" +
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 131..139
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 149..157
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 166..175
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 177..185
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 208..216
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 239..247
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 273..281
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 290..298
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 300..308
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 389..397

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

    @Test
    public void testUpdateActionSpacedValueInQuotes() throws Exception {
        final String jsonPathQuery = "$.arrayTest";
        final Map<String, String> result = editJson.execute(jsonFile, jsonPathQuery, "update", "new Author",
                "\"new Author value\"", VALIDATE_VALUE_FALSE);
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 131..139
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 149..157
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 177..185
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 208..216
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 239..247
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 273..281
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 290..298
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 300..308
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 365..373
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 389..397

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

    @Test
    public void testUpdateActionMultipleValues() throws Exception {
        final String jsonPathQuery = "$.store.book[*].author";
        final Map<String, String> result = editJson.execute(jsonFile, jsonPathQuery, "update", "", "newAuthor", VALIDATE_VALUE_FALSE);
        assertEquals("{\"store\":{\"book\":[{\"category\":\"reference\",\"author\":\"newAuthor\",\"title\":" +
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 131..139
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 149..157
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 166..175
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 208..216
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 239..247
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 273..281
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 290..298
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 300..308
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 365..373
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 389..397

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

    @Test
    public void testInsertActionSpacedValueInQuotes() throws Exception {
        final String jsonPathQuery = "$.store";
        final Map<String, String> result = editJson.execute(jsonFile, jsonPathQuery, "insert", "new Author", "\"new Author value\"", VALIDATE_VALUE_FALSE);
        assertEquals("{\"store\":{\"book\":[{\"category\":\"reference\",\"author\":\"Nigel Rees\",\"title\":" +
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 131..139
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 149..157
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 166..175
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 177..185
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 208..216
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 239..247
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 273..281
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 300..308
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 365..373
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 389..397

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

    @Test
    public void testUpdateActionSpacedValue() throws Exception {
        final String jsonPathQuery = "$.arrayTest";
        final Map<String, String> result = editJson.execute(jsonFile, jsonPathQuery, "update", "", "new Author value", VALIDATE_VALUE_FALSE);
        assertEquals("{\"store\":{\"book\":[{\"category\":\"reference\",\"author\":\"Nigel Rees\",\"title\":" +
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 131..139
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 166..175
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 177..185
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 208..216
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 239..247
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 273..281
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 290..298
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 300..308
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 365..373
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 389..397

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

    @Test
    public void testExecutePropertyValueArrayValidateValue() {
        String jsonObject = "{}";
        String name = "test";
        String value = "[1,2,3]";
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 70..77
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 79..86
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 98..105
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 107..114
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 116..123
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 154..161
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 163..170
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 172..179

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

    @Test
    public void testInsertActionArrayAsNewItem() throws Exception {
        final String jsonPathQuery = "$.store.book[0]";
        final Map<String, String> result = editJson.execute(jsonFile, jsonPathQuery, "insert", "newArray", "[1,2,3]", VALIDATE_VALUE_FALSE);
        assertEquals("{\"store\":{\"book\":[{\"category\":\"reference\",\"author\":\"Nigel Rees\",\"title\":" +
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 131..139
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 149..157
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 166..175
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 177..185
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 208..216
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 273..281
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 290..298
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 300..308
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 365..373
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 389..397

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

    @Test
    public void testInsertActionSpacedValue() throws Exception {
        final String jsonPathQuery = "$.store";
        final Map<String, String> result = editJson.execute(jsonFile, jsonPathQuery, "insert", "new Author", "new A/uthor value", VALIDATE_VALUE_FALSE);
        assertEquals("{\"store\":{\"book\":[{\"category\":\"reference\",\"author\":\"Nigel Rees\",\"title\":" +
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 131..139
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 149..157
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 166..175
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 177..185
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 208..216
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 239..247
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 290..298
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 300..308
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 365..373
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 389..397

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

    @Test
    public void testAddActionArray() throws Exception {
        final String jsonPathQuery = "$.arrayTest";
        final Map<String, String> result = editJson.execute(jsonFile, jsonPathQuery, "add", "", "value", VALIDATE_VALUE_FALSE);
        assertEquals("{\"store\":{\"book\":[{\"category\":\"reference\",\"author\":\"Nigel Rees\",\"title\":" +
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 131..139
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 149..157
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 166..175
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 177..185
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 208..216
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 239..247
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 273..281
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 290..298
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 300..308
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 365..373

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

    @Test
    public void testExecutePropertyValueJsonValidateValue() {
        String jsonObject = "{}";
        String name = "test";
        String value = "{\"a\":\"b\"}";
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 70..77
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 79..86
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 98..105
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 116..123
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 125..132
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 154..161
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 163..170
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 172..179

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

    @Test
    public void testUpdateActionValue() throws Exception {
        final String jsonPathQuery = "$.store.book[0].category";
        final Map<String, String> result = editJson.execute(jsonFile, jsonPathQuery, "update", "", "newCategory", VALIDATE_VALUE_FALSE);
        assertEquals("{\"store\":{\"book\":[{\"category\":\"newCategory\",\"author\":\"Nigel Rees\",\"title\":" +
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 149..157
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 166..175
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 177..185
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 208..216
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 239..247
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 273..281
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 290..298
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 300..308
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 365..373
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 389..397

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

    @Test
    public void testInsertActionSpacedValueInQuotesValidateValue() throws Exception {
        final String jsonPathQuery = "$.store";
        final Map<String, String> result = editJson.execute(jsonFile, jsonPathQuery, "insert", "new Author", "\"new Author value\"", VALIDATE_VALUE_TRUE);
        assertEquals("{\"store\":{\"book\":[{\"category\":\"reference\",\"author\":\"Nigel Rees\",\"title\":" +
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 131..139
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 149..157
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 166..175
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 177..185
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 208..216
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 239..247
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 273..281
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 290..298
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 365..373
cs-json/src/test/java/io/cloudslang/content/json/actions/EditJsonTest.java on lines 389..397

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

    @Test
    public void testExecutePropertyValueBad() {
        String jsonObject = "{}";
        String name = "test";
        String value = "1\"{";
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 70..77
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 98..105
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 107..114
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 116..123
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 125..132
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 154..161
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 163..170
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 172..179

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

    @Test
    public void testExecuteJsonObjectComplexValidateValue() {
        String jsonObject = "{\"one\":{\"a\":\"a\",\"B\":\"B\"}, \"two\":\"two\", \"three\":[1,2,3.4]}";
        String name = "test";
        String value = "{\"a\":\"b\"}";
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 70..77
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 79..86
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 98..105
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 107..114
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 116..123
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 125..132
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 154..161
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 172..179

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

    @Test
    public void testExecutePropertyValueArray() {
        String jsonObject = "{}";
        String name = "test";
        String value = "[1,2,3]";
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 70..77
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 79..86
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 98..105
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 107..114
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 125..132
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 154..161
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 163..170
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 172..179

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

    @Test
    public void testExecuteJsonObjectComplexPropertyString() {
        String jsonObject = "{\"one\":{\"a\":\"a\",\"B\":\"B\"}, \"two\":\"two\", \"three\":[1,2,3.4]}";
        String name = "test";
        String value = "a";
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 70..77
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 79..86
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 98..105
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 107..114
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 116..123
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 125..132
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 154..161
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 163..170

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

    @Test
    public void testExecutePropertyValueJson() {
        String jsonObject = "{}";
        String name = "test";
        String value = "{\"a\":\"b\"}";
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 70..77
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 79..86
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 107..114
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 116..123
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 125..132
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 154..161
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 163..170
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 172..179

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

    @Test
    public void testExecuteJsonObjectComplex() {
        String jsonObject = "{\"one\":{\"a\":\"a\",\"B\":\"B\"}, \"two\":\"two\", \"three\":[1,2,3.4]}";
        String name = "test";
        String value = "{\"a\":\"b\"}";
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 70..77
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 79..86
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 98..105
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 107..114
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 116..123
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 125..132
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 163..170
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 172..179

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

    @Test
    public void testExecuteNameBad() {
        String jsonObject = "{}";
        String name = "test{\"";
        String value = "1";
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 79..86
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 98..105
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 107..114
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 116..123
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 125..132
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 154..161
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 163..170
cs-json/src/test/java/io/cloudslang/content/json/actions/AddJsonPropertyToObjectTest.java on lines 172..179

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

    public static String getDatastoreIdByName(Datastore datastoreService, String datastoreName) {
        DatastoreTypes.FilterSpec filterSpec = new DatastoreTypes.FilterSpec();
        filterSpec.setNames(Collections.singleton(datastoreName));
        try {
            return datastoreService.list(filterSpec).get(0).getDatastore();
cs-vmware-commons/src/main/java/io/cloudslang/content/vmware/commons/utils/Utils.java on lines 86..94
cs-vmware-commons/src/main/java/io/cloudslang/content/vmware/commons/utils/Utils.java on lines 96..104
cs-vmware-commons/src/main/java/io/cloudslang/content/vmware/commons/utils/Utils.java on lines 106..114
cs-vmware-commons/src/main/java/io/cloudslang/content/vmware/commons/utils/Utils.java on lines 116..124

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

Severity
Category
Status
Source
Language