Showing 114 of 114 total issues
File InfluxDBImpl.java
has 805 lines of code (exceeds 250 allowed). Consider refactoring. Open
package org.influxdb.impl;
import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.Moshi;
import okhttp3.Headers;
Method traverse
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
void traverse(final MessageUnpacker unpacker, final QueryResultModelPath queryResultPath, final int readAmount)
throws IOException {
int amount = 0;
while (unpacker.hasNext() && amount < readAmount) {
- Read upRead up
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
InfluxDBImpl
has 62 methods (exceeds 20 allowed). Consider refactoring. Open
public class InfluxDBImpl implements InfluxDB {
private static final String APPLICATION_MSGPACK = "application/x-msgpack";
static final okhttp3.MediaType MEDIA_TYPE_STRING = MediaType.parse("text/plain");
InfluxDB
has 50 methods (exceeds 20 allowed). Consider refactoring. Open
public interface InfluxDB extends AutoCloseable {
/**
* The system property key to set the http logging level across the JVM.
* @see LogLevel for available values
File Point.java
has 453 lines of code (exceeds 250 allowed). Consider refactoring. Open
package org.influxdb.dto;
import org.influxdb.BuilderException;
import org.influxdb.InfluxDBMapperException;
import org.influxdb.annotation.Column;
Method traverse
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
void traverse(final MessageUnpacker unpacker, final QueryResultModelPath queryResultPath, final int readAmount)
throws IOException {
int amount = 0;
while (unpacker.hasNext() && amount < readAmount) {
QueryBuilder
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
public static final class QueryBuilder {
private QueryBuilder() {
}
Method addFieldsFromPOJO
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public Builder addFieldsFromPOJO(final Object pojo) {
Class<?> clazz = pojo.getClass();
Measurement measurement = clazz.getAnnotation(Measurement.class);
boolean allFields = measurement != null && measurement.allFields();
- Read upRead up
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 parseSeriesAs
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
<T> List<T> parseSeriesAs(final QueryResult.Series series, final Class<T> clazz, final List<T> result,
final TimeUnit precision) {
int columnSize = series.getColumns().size();
ClassInfo classInfo = CLASS_INFO_CACHE.get(clazz.getName());
- Read upRead up
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
SelectionQueryImpl
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
public class SelectionQueryImpl implements Selection, WithInto {
private final SelectionCoreImpl selectionCore;
private boolean requiresPost;
File BatchProcessor.java
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
package org.influxdb.impl;
import org.influxdb.InfluxDB;
import org.influxdb.InfluxDB.ConsistencyLevel;
import org.influxdb.dto.BatchPoints;
SelectionSubQueryImpl
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
public class SelectionSubQueryImpl<T extends WithSubquery> extends SubQuery<T>
implements Selection, WithSubquery {
private final SelectionCoreImpl selectionCore;
Method adaptValue
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private static Object adaptValue(final Class<?> fieldType, final Object value, final TimeUnit precision,
final String fieldName, final String className) {
try {
if (String.class.isAssignableFrom(fieldType)) {
return String.valueOf(value);
- Read upRead up
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
SelectionCoreImpl
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class SelectionCoreImpl implements Selection, WithInto {
protected List<Object> columns;
protected boolean isDistinct;
private String intoMeasurement;
Method cacheMeasurementClass
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
void cacheMeasurementClass(final Class<?>... classVarAgrs) {
for (Class<?> clazz : classVarAgrs) {
if (CLASS_INFO_CACHE.containsKey(clazz.getName())) {
continue;
}
- Read upRead up
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 query
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void query(final Query query, final int chunkSize, final BiConsumer<Cancellable, QueryResult> onNext,
final Runnable onComplete, final Consumer<Throwable> onFailure) {
Call<ResponseBody> call;
if (query instanceof BoundParameterQuery) {
Method buildQueryString
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
@Override
public StringBuilder buildQueryString(final StringBuilder builder) {
builder.append("SELECT ");
if (isDistinct) {
- Read upRead up
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 write
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
void write() {
List<Point> currentBatch = null;
try {
if (this.queue.isEmpty()) {
BatchProcessor.this.batchWriter.write(Collections.emptyList());
- Read upRead up
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
Point
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
public class Point {
private String measurement;
private Map<String, String> tags;
private Number time;
private TimeUnit precision = TimeUnit.NANOSECONDS;
Method write
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
@Override
public synchronized void write(final Collection<BatchPoints> collection) {
// empty the cached data first
ListIterator<BatchPoints> batchQueueIterator = batchQueue.listIterator();
while (batchQueueIterator.hasNext()) {
- Read upRead up
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"