Method parsingRootStructure
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
protected String parsingRootStructure(ClassModel model, Clazz clazz, SimpleKeyValueList<Clazz, String> classTypes,
SimpleKeyValueList<String, XMLEntity> typesValues, Clazz parent) {
if (model == null || classTypes == null || typesValues == 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
File XSDEntity.java
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
package de.uniks.networkparser.xml;
/*
NetworkParser
The MIT License
Method parsingRootStructure
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected String parsingRootStructure(ClassModel model, Clazz clazz, SimpleKeyValueList<Clazz, String> classTypes,
SimpleKeyValueList<String, XMLEntity> typesValues, Clazz parent) {
if (model == null || classTypes == null || typesValues == null) {
return null;
}
XSDEntity
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
public class XSDEntity extends XMLEntity implements SendableEntityCreator {
public static final String XSD_COMPLEX_TYPE = ":complexType";
public static final String XSD_ELEMENT_TYPE = ":element";
public static final String XSD_STRING_TYPE = ":string";
public static final String XSD_SEQUENCE_TYPE = ":sequence";
Method cleanUp
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public boolean cleanUp(String prefix) {
if (prefix == null) {
return false;
}
- 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 createModel
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public ClassModel createModel(String prefix) {
ClassModel model = new ClassModel();
if (prefix == null) {
return model;
}
Method createModel
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public ClassModel createModel(String prefix) {
ClassModel model = new ClassModel();
if (prefix == null) {
return model;
}
- 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 cleanUp
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean cleanUp(String prefix) {
if (prefix == null) {
return false;
}
Method cleanUpTypes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private void cleanUpTypes(String prefix, SimpleKeyValueList<String, String> simpleReplaceType, XMLEntity parent) {
String elementType = prefix + XSD_ELEMENT_TYPE;
if (parent == null) {
return;
}
- 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 deeply nested control flow statements. Open
if (pos >= 0) {
simpleReplaceType.put(name, stringType);
simpleReplaceType.setValue(pos, stringType);
} else {
simpleReplaceType.put(name, stringType);
Avoid deeply nested control flow statements. Open
if ("0".equals(element.getMinOccurs()) == false) {
/* ITS NESSESSARY */
attr.withValue("\"\"");
System.out.println("MUST BE INIT: " + clazz.getName() + ":" + name);
}
Method setValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean setValue(Object entity, String attribute, Object value, String type) {
if (entity == null || entity instanceof XSDEntity == false) {
return false;
}
- 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 parsingRootStructure
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected String parsingRootStructure(ClassModel model, Clazz clazz, SimpleKeyValueList<Clazz, String> classTypes,
SimpleKeyValueList<String, XMLEntity> typesValues, Clazz parent) {
Avoid too many return
statements within this method. Open
return xsd.setMinOccurs((String) value);
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return xsd.setTag((String) value);
Avoid too many return
statements within this method. Open
return xsd.setMaxOccurs((String) value);