Showing 9 of 19 total issues
File EventStoreLayer.java
has 433 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
package com.eventfully.foundationdb.eventstore;
import com.apple.foundationdb.Database;
import com.apple.foundationdb.KeySelector;
import com.apple.foundationdb.KeyValue;
EventStoreLayer
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class EventStoreLayer implements EventStore {
private static final Logger LOG = LoggerFactory.getLogger(EventStoreLayer.class);
public static final int MAX_READ_SIZE = 4096;
Method readAllBackwardInternal
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private CompletableFuture<ReadAllSlice> readAllBackwardInternal(ReadTransaction tr, Versionstamp fromPositionInclusive, int maxCount) {
Subspace globalSubspace = getGlobalSubspace();
// add one so we can determine if we are at the end of the stream
int rangeCount = maxCount + 1;
Method readAllForwardInternal
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private CompletableFuture<ReadAllSlice> readAllForwardInternal(ReadTransaction tr, Versionstamp fromPositionInclusive, int maxCount) {
Subspace globalSubspace = getGlobalSubspace();
// add one so we can determine if we are at the end of the stream
int rangeCount = maxCount + 1;
Method readStreamForwardsInternal
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private CompletableFuture<ReadStreamSlice> readStreamForwardsInternal(ReadTransaction tr,
StreamId streamId,
long fromVersionInclusive,
int maxCount) {
Subspace streamSubspace = getStreamSubspace(streamId);
Method readStreamBackwardsInternal
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private CompletableFuture<ReadStreamSlice> readStreamBackwardsInternal(ReadTransaction tr,
StreamId streamId,
long fromVersionInclusive,
int maxCount) {
Subspace streamSubspace = getStreamSubspace(streamId);
Method setStreamMetadata
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public SetStreamMetadataResult setStreamMetadata(String streamId,
long expectedStreamMetadataVersion,
Integer maxAge,
Integer maxCount,
String metadataJson) {
Method setStreamMetadata
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
SetStreamMetadataResult setStreamMetadata(String streamId,
long expectedStreamMetadataVersion,
Integer maxAge,
Integer maxCount,
String metadataJson);
Method equals
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
- 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"