skofgar/mercury

View on GitHub

Showing 244 of 821 total issues

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

                        } else {
                            byte[] payload = SimpleMapper.getInstance().getMapper().writeValueAsBytes(responseBody);
                            response.putHeader(CONTENT_LEN, String.valueOf(payload.length));
                            response.write(Buffer.buffer(payload));
                        }
system/platform-core/src/main/java/org/platformlambda/automation/services/ServiceResponseHandler.java on lines 234..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 46.

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 (value instanceof String) {
            String s = (String) value;
            if (s.startsWith("${") && s.endsWith("}")) {
                return Utility.getInstance().getEnvVariable(s);
            }
system/platform-core/src/main/java/org/platformlambda/core/util/ConfigReader.java on lines 55..60

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

                } else {
                    Map<String, Object> response = new HashMap<>();
                    response.put(TYPE, EVENT);
                    response.put(EVENT, payload);
                    PostOffice.getInstance().send(txPath, msgPack.pack(response));
language-packs/language-connector/src/main/java/org/platformlambda/lang/services/LanguageRelay.java on lines 116..121

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

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

            } else {
                Map<String, Object> relay = new HashMap<>();
                relay.put(TYPE, EVENT);
                relay.put(EVENT, payload);
                PostOffice.getInstance().send(txPath, msgPack.pack(relay));
language-packs/language-connector/src/main/java/org/platformlambda/lang/services/LanguageInbox.java on lines 117..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 46.

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

                        } else {
                            byte[] payload = SimpleMapper.getInstance().getMapper().writeValueAsBytes(responseBody);
                            response.putHeader(CONTENT_LEN, String.valueOf(payload.length));
                            response.write(Buffer.buffer(payload));
                        }
system/platform-core/src/main/java/org/platformlambda/automation/services/ServiceResponseHandler.java on lines 213..217

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

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

            if (o instanceof List) {
                current = (List<Object>) o;
            } else {
                List<Object> newList = new ArrayList<>();
                current.set(idx, newList);
system/platform-core/src/main/java/org/platformlambda/core/util/MultiLevelMap.java on lines 214..220

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

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

                    if (next instanceof Map) {
                        current = (Map<String, Object>) next;
                    } else {
                        Map<String, Object> nextMap = new HashMap<>();
                        current.put(p, nextMap);
system/platform-core/src/main/java/org/platformlambda/core/util/MultiLevelMap.java on lines 260..266

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

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

                case NOT_AVAILABLE_EXCEPTION:
                    status = Response.Status.SERVICE_UNAVAILABLE.getStatusCode();
                    if (errorMessage == null) {
                        errorMessage = Response.Status.SERVICE_UNAVAILABLE.getReasonPhrase();
                    }
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 106..111
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 112..117
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 118..123
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 125..130
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 131..136
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 137..142
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 143..148

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

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

                case NOT_ALLOWED_EXCEPTION:
                    status = Response.Status.METHOD_NOT_ALLOWED.getStatusCode();
                    if (errorMessage == null) {
                        errorMessage = Response.Status.METHOD_NOT_ALLOWED.getReasonPhrase();
                    }
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 106..111
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 112..117
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 125..130
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 131..136
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 137..142
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 143..148
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 149..154

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

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

                case BAD_REQUEST_EXCEPTION:
                    status = Response.Status.BAD_REQUEST.getStatusCode();
                    if (errorMessage == null) {
                        errorMessage = Response.Status.BAD_REQUEST.getReasonPhrase();
                    }
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 106..111
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 112..117
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 118..123
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 131..136
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 137..142
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 143..148
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 149..154

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

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

                case FORBIDDEN_EXCEPTION:
                    status = Response.Status.FORBIDDEN.getStatusCode();
                    if (errorMessage == null) {
                        errorMessage = Response.Status.FORBIDDEN.getReasonPhrase();
                    }
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 106..111
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 112..117
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 118..123
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 125..130
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 137..142
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 143..148
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 149..154

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

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

                case NOT_ACCEPTABLE_EXCEPTION:
                    status = Response.Status.NOT_ACCEPTABLE.getStatusCode();
                    if (errorMessage == null) {
                        errorMessage = Response.Status.NOT_ACCEPTABLE.getReasonPhrase();
                    }
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 106..111
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 112..117
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 118..123
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 125..130
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 131..136
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 143..148
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 149..154

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

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

                case NOT_FOUND_EXCEPTION:
                    status = Response.Status.NOT_FOUND.getStatusCode();
                    if (errorMessage == null) {
                        errorMessage = Response.Status.NOT_FOUND.getReasonPhrase();
                    }
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 112..117
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 118..123
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 125..130
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 131..136
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 137..142
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 143..148
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 149..154

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

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

                case NOT_SUPPORTED_EXCEPTION:
                    status = Response.Status.UNSUPPORTED_MEDIA_TYPE.getStatusCode();
                    if (errorMessage == null) {
                        errorMessage = Response.Status.UNSUPPORTED_MEDIA_TYPE.getReasonPhrase();
                    }
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 106..111
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 118..123
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 125..130
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 131..136
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 137..142
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 143..148
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 149..154

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

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

                case NOT_AUTHORIZED_EXCEPTION:
                    status = Response.Status.UNAUTHORIZED.getStatusCode();
                    if (errorMessage == null) {
                        errorMessage = Response.Status.UNAUTHORIZED.getReasonPhrase();
                    }
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 106..111
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 112..117
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 118..123
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 125..130
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 131..136
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 137..142
system/rest-spring/src/main/java/org/platformlambda/rest/exception/RestExceptionHandler.java on lines 149..154

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

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

    @Override
    public void deleteTopic(String topic) throws IOException {
        try {
            PostOffice.getInstance().request(cloudManager, 20000, new Kv(TYPE, DELETE), new Kv(TOPIC, topic));
        } catch (TimeoutException | AppException e) {
connectors/adapters/activemq/activemq-connector/src/main/java/org/platformlambda/activemq/services/PubSubManager.java on lines 129..136
connectors/adapters/activemq/activemq-connector/src/main/java/org/platformlambda/activemq/services/PubSubManager.java on lines 143..150
connectors/adapters/hazelcast/hazelcast-connector/src/main/java/org/platformlambda/hazelcast/services/PubSubManager.java on lines 109..116
connectors/adapters/kafka/kafka-connector/src/main/java/org/platformlambda/kafka/services/PubSubManager.java on lines 168..175
connectors/adapters/tibco/tibco-connector/src/main/java/org/platformlambda/tibco/services/PubSubManager.java on lines 144..151

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

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

            try {
                clusterConfig = ConnectorConfig.getConfig(location,
                        "file:/tmp/config/hazelcast.properties,classpath:/hazelcast.properties");
            } catch (IOException e) {
                log.error("Unable to find hazelcast properties - {}", e.getMessage());
connectors/adapters/activemq/activemq-connector/src/main/java/org/platformlambda/activemq/ArtemisConnector.java on lines 70..76
connectors/adapters/kafka/kafka-connector/src/main/java/org/platformlambda/kafka/KafkaConnector.java on lines 69..75
connectors/adapters/tibco/tibco-connector/src/main/java/org/platformlambda/tibco/TibcoConnector.java on lines 82..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 44.

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

    @Override
    public void deleteTopic(String topic) throws IOException {
        try {
            PostOffice.getInstance().request(cloudManager, 20000, new Kv(TYPE, DELETE), new Kv(TOPIC, topic));
        } catch (TimeoutException | AppException e) {
connectors/adapters/activemq/activemq-connector/src/main/java/org/platformlambda/activemq/services/PubSubManager.java on lines 129..136
connectors/adapters/activemq/activemq-connector/src/main/java/org/platformlambda/activemq/services/PubSubManager.java on lines 143..150
connectors/adapters/kafka/kafka-connector/src/main/java/org/platformlambda/kafka/services/PubSubManager.java on lines 168..175
connectors/adapters/tibco/tibco-connector/src/main/java/org/platformlambda/tibco/services/PubSubManager.java on lines 130..137
connectors/adapters/tibco/tibco-connector/src/main/java/org/platformlambda/tibco/services/PubSubManager.java on lines 144..151

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

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

    @Override
    public void deleteTopic(String topic) throws IOException {
        try {
            PostOffice.getInstance().request(cloudManager, 20000, new Kv(TYPE, DELETE), new Kv(TOPIC, topic));
        } catch (TimeoutException | AppException e) {
connectors/adapters/activemq/activemq-connector/src/main/java/org/platformlambda/activemq/services/PubSubManager.java on lines 143..150
connectors/adapters/hazelcast/hazelcast-connector/src/main/java/org/platformlambda/hazelcast/services/PubSubManager.java on lines 109..116
connectors/adapters/kafka/kafka-connector/src/main/java/org/platformlambda/kafka/services/PubSubManager.java on lines 168..175
connectors/adapters/tibco/tibco-connector/src/main/java/org/platformlambda/tibco/services/PubSubManager.java on lines 130..137
connectors/adapters/tibco/tibco-connector/src/main/java/org/platformlambda/tibco/services/PubSubManager.java on lines 144..151

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

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

    @Override
    public void deleteTopic(String topic) throws IOException {
        try {
            PostOffice.getInstance().request(cloudManager, 20000, new Kv(TYPE, DELETE), new Kv(TOPIC, topic));
        } catch (TimeoutException | AppException e) {
connectors/adapters/activemq/activemq-connector/src/main/java/org/platformlambda/activemq/services/PubSubManager.java on lines 129..136
connectors/adapters/activemq/activemq-connector/src/main/java/org/platformlambda/activemq/services/PubSubManager.java on lines 143..150
connectors/adapters/hazelcast/hazelcast-connector/src/main/java/org/platformlambda/hazelcast/services/PubSubManager.java on lines 109..116
connectors/adapters/tibco/tibco-connector/src/main/java/org/platformlambda/tibco/services/PubSubManager.java on lines 130..137
connectors/adapters/tibco/tibco-connector/src/main/java/org/platformlambda/tibco/services/PubSubManager.java on lines 144..151

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

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