Showing 821 of 821 total issues
Method handleEvent
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Object handleEvent(Map<String, String> headers, Object body, int instance) throws Exception {
if (headers.containsKey(TO) && body instanceof byte[]) {
List<String> destinations = getDestinations(headers);
if (!destinations.isEmpty()) {
Identical blocks of code found in 4 locations. Consider refactoring. Open
@Override
public int partitionCount(String topic) throws IOException {
try {
EventEnvelope response = PostOffice.getInstance().request(cloudManager, 20000,
new Kv(TYPE, PARTITIONS), new Kv(TOPIC, topic));
- Read upRead up
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 74.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 4 locations. Consider refactoring. Open
@Override
public int partitionCount(String topic) throws IOException {
try {
EventEnvelope response = PostOffice.getInstance().request(cloudManager, 20000,
new Kv(TYPE, PARTITIONS), new Kv(TOPIC, topic));
- Read upRead up
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 74.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 4 locations. Consider refactoring. Open
@Override
public int partitionCount(String topic) throws IOException {
try {
EventEnvelope response = PostOffice.getInstance().request(cloudManager, 20000,
new Kv(TYPE, PARTITIONS), new Kv(TOPIC, topic));
- Read upRead up
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 74.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 4 locations. Consider refactoring. Open
@Override
public int partitionCount(String topic) throws IOException {
try {
EventEnvelope response = PostOffice.getInstance().request(cloudManager, 20000,
new Kv(TYPE, PARTITIONS), new Kv(TOPIC, topic));
- Read upRead up
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 74.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
connection.setExceptionListener((e) -> {
String error = e.getMessage();
log.error("Activemq cluster exception - {}", error);
if (error != null && (error.contains("terminated") || error.contains("disconnect"))) {
ArtemisConnector.stopConnection(domain);
- Read upRead up
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 74.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
connection.setExceptionListener((e) -> {
String error = e.getMessage();
log.error("Tibco cluster exception - {}", error);
if (error != null && (error.contains("terminated") || error.contains("disconnect"))) {
TibcoConnector.stopConnection(domain);
- Read upRead up
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 74.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method getRouteInfo
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public AssignedRoute getRouteInfo(String method, String url) {
Utility util = Utility.getInstance();
StringBuilder sb = new StringBuilder();
List<String> input = util.split(url, "/");
for (String p: input) {
Method register
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings("rawtypes")
private void register(String route, TypedLambdaFunction lambda, boolean isPrivate, int instances)
throws IOException {
if (lambda == null) {
throw new IOException("Missing lambda function");
Method loadMulticast
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
private void loadMulticast(Map<String, Object> map) {
Set<String> list = new HashSet<>();
Platform platform = Platform.getInstance();
MultiLevelMap multi = new MultiLevelMap(map);
Method suspendResume
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void suspendResume(HttpServerResponse response, String uri, String origin) {
if (origin == null) {
sendError(response, uri, 400, "Missing "+ APP_INSTANCE +" in request header");
return;
}
Method getBody
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
public Object getBody() {
if (!encoded) {
if (type == null) {
setBody(body);
Method registerStream
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void registerStream(String route, StreamFunction lambda, boolean isPrivate) throws IOException {
if (lambda == null) {
throw new IOException("Missing lambda function");
}
String path = getValidatedRoute(route);
Method handleEvent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Object handleEvent(Map<String, String> headers, Object body, int instance) {
if (body instanceof String && db != null && dbEnv != null) {
Utility util = Utility.getInstance();
int n = 0;
Method getClient
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static synchronized HazelcastInstance getClient(String domain, Properties properties) {
HazelcastInstance client = allClients.get(domain);
if (client == null) {
Utility util = Utility.getInstance();
String url = properties.getProperty(BROKER_URL);
Method getReplicationFactor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private int getReplicationFactor() {
if (topicSubstitution) {
return 1;
}
if (replicationFactor == -1) {
Method topicPartitions
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private int topicPartitions(String topic) throws TibjmsAdminException {
if (topicSubstitution) {
int n = 0;
while (preAllocatedTopics.containsKey(topic+"."+n)) {
n++;
Identical blocks of code found in 4 locations. Consider refactoring. Open
@Override
public boolean exists(String topic) throws IOException {
try {
EventEnvelope response = PostOffice.getInstance().request(cloudManager, 20000,
new Kv(TYPE, EXISTS), new Kv(TOPIC, topic));
- Read upRead up
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 72.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (CREATE.equals(headers.get(TYPE)) && headers.containsKey(TOPIC)) {
int partitions = headers.containsKey(PARTITIONS)?
Math.max(1, Utility.getInstance().str2int(headers.get(PARTITIONS))) : 1;
createTopic(headers.get(TOPIC), partitions);
return true;
- Read upRead up
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 72.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (value == null) {
v = "";
} else if (value instanceof String) {
v = (String) value;
} else if (value instanceof Date) {
- Read upRead up
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 72.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76