Showing 298 of 302 total issues
Method build
has a Cognitive Complexity of 277 (exceeds 50 allowed). Consider refactoring. Open
/**
* Load a raw set of mapped data, from underlying storage, into a message builder so that it may be constructed into
* a concrete Protobuf representation.
*
* @param builder
- Read upRead up
- Create a ticketCreate a ticket
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 collapseMessage
has a Cognitive Complexity of 123 (exceeds 50 allowed). Consider refactoring. Open
/**
* Recursive boundary for message collapsing operations. "Collapsing" a message refers to converting it into a
* serialized set of operations, each of which represents an interaction with underlying storage, and collectively
* which, define the underlying set of writes that constitute the materialized entity being written.
*
- Read upRead up
- Create a ticketCreate a ticket
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 extractSubmessage
has a Cognitive Complexity of 107 (exceeds 50 allowed). Consider refactoring. Open
/**
* Extract a sub-message field, where a potential value means we may need to recurse and decode it, too. In cases
* where the sub-message is a default value, only recurse if we are directed by configuration to include default
* values while serializing.
*
- Read upRead up
- Create a ticketCreate a ticket
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
PageContextManager
has 92 methods (exceeds 50 allowed). Consider refactoring. Open
@RequestScope
@SuppressWarnings("unused")
public class PageContextManager implements Closeable, AutoCloseable, PageRender {
private static final Logger logging = Logging.logger(PageContextManager.class);
- Create a ticketCreate a ticket
Method convergeColumnField
has a Cognitive Complexity of 102 (exceeds 50 allowed). Consider refactoring. Open
private void convergeColumnField(@Nonnull Message.Builder target,
@Nonnull Struct source,
@Nonnull ModelMetadata.FieldPointer fieldPointer) {
// resolve any generic column options and spanner extension options
var columnOpts = columnOpts(fieldPointer);
- Read upRead up
- Create a ticketCreate a ticket
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 finalizeResponse
has a Cognitive Complexity of 101 (exceeds 50 allowed). Consider refactoring. Open
@Override
public @Nonnull <T> MutableHttpResponse<T> finalizeResponse(@Nonnull HttpRequest<?> request,
@Nonnull MutableHttpResponse<T> soyResponse,
@Nonnull T body,
@Nullable MessageDigest digester) {
- Read upRead up
- Create a ticketCreate a ticket
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 scanForParent
has a Cognitive Complexity of 98 (exceeds 50 allowed). Consider refactoring. Open
/**
* Find the parent field, and potentially parent ID value, for a given message. The `PARENT` annotation should be
* affixed to an object field, which itself makes reference to an `ID`-annotated property. Find this ID property, and
* extract its value. Return a triple of the value, the object it was mounted on, and the field descriptor describing
* the field that contained the ID.
- Read upRead up
- Create a ticketCreate a ticket
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 scanForIdProperty
has a Cognitive Complexity of 87 (exceeds 50 allowed). Consider refactoring. Open
/**
* Find the ID field, value, and entity for a given message. If the ID field is nested inside a key object, find it
* anyway. Return a triple of the found ID, message it was mounted on, and field descriptor, if it could be found,
* otherwise null in each case or where things could not be found.
*
- Read upRead up
- Create a ticketCreate a ticket
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 bindValueTyped
has a Cognitive Complexity of 77 (exceeds 50 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
<Primitive> void bindValueTyped(@Nonnull Descriptors.FieldDescriptor field,
@Nonnull ValueBinder<Primitive> valueBinder,
@Nonnull Type columnType,
@Nonnull Object rawValue,
- Read upRead up
- Create a ticketCreate a ticket
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 convergeColumnField
has 291 lines of code (exceeds 200 allowed). Consider refactoring. Open
private void convergeColumnField(@Nonnull Message.Builder target,
@Nonnull Struct source,
@Nonnull ModelMetadata.FieldPointer fieldPointer) {
// resolve any generic column options and spanner extension options
var columnOpts = columnOpts(fieldPointer);
- Create a ticketCreate a ticket
ModelMetadata
has 61 methods (exceeds 50 allowed). Consider refactoring. Open
@ThreadSafe
@SuppressWarnings({"WeakerAccess", "unused", "OptionalUsedAsFieldOrParameterType"})
public final class ModelMetadata {
private ModelMetadata() { /* Disallow construction. */ }
- Create a ticketCreate a ticket
Method extractAndSetValue
has a Cognitive Complexity of 68 (exceeds 50 allowed). Consider refactoring. Open
/**
* Extract a value from the given concrete message object, at the specified field. If there is a value, and it is
* eligible to be included (i.e. default values are being included, and it is a default value, or it is not a default
* value), then set it using the builder method also given.
*
- Read upRead up
- Create a ticketCreate a ticket
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 affixHeaders
has a Cognitive Complexity of 63 (exceeds 50 allowed). Consider refactoring. Open
@SuppressWarnings({"WeakerAccess", "SameParameterValue"})
protected @Nonnull <T> MutableHttpResponse<T> affixHeaders(@Nonnull MutableHttpResponse<T> response,
@Nonnull DynamicServingConfiguration config) {
// first up: content language
if (this.context.language().isPresent()) {
- Read upRead up
- Create a ticketCreate a ticket
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 compareUnknownFields
has a Cognitive Complexity of 61 (exceeds 50 allowed). Consider refactoring. Open
private boolean compareUnknownFields(
Message message1,
Message message2,
UnknownFieldSet unknownFieldSet1,
UnknownFieldSet unknownFieldSet2,
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid deeply nested control flow statements. Open
if ((reporter == null) || !reportMatches) {
continue;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if ((reportType != ReportType.MATCHED) || reportMatches) {
reporter.report(reportType, message1, message2, immutable(stack, unknownField));
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (isSet(canonical)) {
//noinspection OptionalGetWithoutIsPresent
String lastModifiedValue = lastModified.get();
if (lastModifiedValue.length() == 10)
entry.setLastModified(lastModifiedValue);
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (contentDigest.equals(Objects.requireNonNull(request.getHeaders()
.get(HttpHeaders.IF_NONE_MATCH))
.replace("\"", "")
.replace("W/", ""))) {
if (logging.isDebugEnabled()) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
parentIdScan@ for (subfield in field.messageType.fields) {
if (subfield.type == FieldType.STRING) {
// potentially a parent ID
val subfieldProto = subfield.toProto()
if (subfieldProto.options.hasExtension(Datamodel.field)) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for (subfield in keyType.fields) {
val subfieldProto = subfield.toProto()
if (subfieldProto != null
&& subfieldProto.hasOptions()
&& subfieldProto.options.hasExtension(Datamodel.field)) {
- Create a ticketCreate a ticket