File ArtifactFile.java
has 560 lines of code (exceeds 250 allowed). Consider refactoring. Open
package de.uniks.networkparser.xml;
/*
NetworkParser
The MIT License
ArtifactFile
has 53 methods (exceeds 20 allowed). Consider refactoring. Open
public class ArtifactFile implements SendableEntityCreatorTag, BaseItem, Comparable<ArtifactFile> {
public static final String PROPERTY_MODELVERSION = "modelVersion?";
public static final String PROPERTY_GROUPID = "groupId?";
public static final String PROPERTY_ARTIFACTID = "artifactId?";
public static final String PROPERTY_VERSION = "version?";
Method calculatePomNumber
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public boolean calculatePomNumber(int... newSize) {
int i;
boolean change = false;
if (newSize != null) {
for (i = 0; i < newSize.length; i++) {
- 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 createContext
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static final ArtifactFile createContext(String fileName, String groupId, String time) {
ArtifactFile artifactFile = new ArtifactFile();
if (fileName == null) {
return artifactFile;
}
Method createContext
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static final ArtifactFile createContext(String fileName, String groupId, String time) {
ArtifactFile artifactFile = new ArtifactFile();
if (fileName == null) {
return artifactFile;
}
- 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 calculatePomNumber
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean calculatePomNumber(int... newSize) {
int i;
boolean change = false;
if (newSize != null) {
for (i = 0; i < newSize.length; i++) {
Method withVersion
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public ArtifactFile withVersion(String value) {
this.version = value;
if (value != null) {
int start = 0;
int pos = 0;
- 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 compareTo
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
@Override
public int compareTo(ArtifactFile o) {
if (o == null) {
return 1;
}
- 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 toString
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected String toString(int indentFactor, int indent) {
String spacesChild = "";
String spaces = "";
if (indentFactor > 0) {
spacesChild = "\r\n" + EntityUtil.repeat(' ', indent + indentFactor);
Method toFile
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public String toFile(boolean groupPath, String... classifier) {
CharacterBuffer file = new CharacterBuffer();
file.with(this.artifactId);
if (groupPath) {
file.with('-');
Method toString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected String toString(int indentFactor, int indent) {
String spacesChild = "";
String spaces = "";
if (indentFactor > 0) {
spacesChild = "\r\n" + EntityUtil.repeat(' ', indent + indentFactor);
- 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 withValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public ArtifactFile withValue(XMLEntity xmlEntity) {
for (String property : getProperties()) {
Object child = getChild(xmlEntity, property);
if (PROPERTY_DEPENDENCIES.equals(property) && child != null) {
/* Parse Dependency */
- 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 toFile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public String toFile(boolean groupPath, String... classifier) {
CharacterBuffer file = new CharacterBuffer();
file.with(this.artifactId);
if (groupPath) {
file.with('-');
- 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 getChild
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private Object getChild(XMLEntity xmlEntity, String value) {
if (value == null || xmlEntity == null) {
return null;
}
- 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
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return ((ArtifactFile) entity).getScope();
Method toGITString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public String toGITString() {
if (System.getenv().get("BUILD_NUMBER") != null) {
try {
pomNumber[5] = Integer.valueOf(System.getenv().get("BUILD_NUMBER"));
} catch (Exception e) {
- 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"