skofgar/mercury

View on GitHub

Showing 821 of 821 total issues

Method encode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public TypedPayload encode(Object obj, boolean binary) {
        if (obj == null) {
            return new TypedPayload(NOTHING, null);
        } else if (obj instanceof Map) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method saveResponse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        private void saveResponse(String inboxId, EventEnvelope reply) {
            Inbox holder = (Inbox) inboxes.get(inboxId);
            if (holder != null) {
                float diff = (float) (System.nanoTime() - holder.begin) / PostOffice.ONE_MILLISECOND;
                reply.setRoundTrip(Float.parseFloat(String.format("%.3f", Math.max(0.0f, diff))));

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method unpack has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private List<Object> unpack(MessageUnpacker unpacker, List<Object> list) throws IOException {
        int len = unpacker.unpackArrayHeader();
        for (int i=0; i < len; i++) {
            MessageFormat mf = unpacker.getNextFormat();
            ValueType type = mf.getValueType();

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method transform has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private Map<String, Object> transform(Map<String, String> headers) {
        // restore the original types for selected key-values
        Utility util = Utility.getInstance();
        Map<String, Object> result = new HashMap<>();
        for (String key: headers.keySet()) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method listFiles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @GET
    @Path("/")
    @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.TEXT_HTML})
    public Map<String, Object> listFiles() throws AppException {
        if (!ready) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method handleEvent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public Object handleEvent(Map<String, String> headers, Object body, int instance) throws Exception {
        if (headers.containsKey(WsEnvelope.TYPE)) {
            String type = headers.get(WsEnvelope.TYPE);
            if (WsEnvelope.OPEN.equals(type)) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

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

    @Override
    public void deleteQueue(String queue) throws IOException {
        try {
            PostOffice.getInstance().request(cloudManager, 20000, new Kv(TYPE, DELETE), new Kv(QUEUE, queue));
        } 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 130..137

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