eo-runtime/src/main/java/org/eolang/PhDefault.java
File PhDefault.java
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* The MIT License (MIT)
*
* Copyright (c) 2016-2024 Objectionary.com
*
Method take
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public Phi take(final String name) {
PhDefault.NESTING.set(PhDefault.NESTING.get() + 1);
final Phi object;
if (this.attrs.containsKey(name)) {
Method φTerm
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public String φTerm() {
final List<String> list = new ArrayList<>(this.attrs.size());
final String format = "%s ↦ %s";
if (this.data.get() != null) {
Method attr
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private String attr(final int pos) {
if (0 > pos) {
throw new ExFailure(
String.format(
"Attribute position can't be negative (%d)",
Method take
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
@Override
public Phi take(final String name) {
PhDefault.NESTING.set(PhDefault.NESTING.get() + 1);
final Phi object;
if (this.attrs.containsKey(name)) {
- 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 delta
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
@Override
public byte[] delta() {
final byte[] bytes;
if (this.data.get() != null) {
bytes = this.data.get();
- 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"