Method parseSheet
has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring. Open
public ExcelSheet parseSheet(CharSequence stringFile, CharSequence sheetFile) {
ExcelSheet data = new ExcelSheet();
SimpleKeyValueList<String, ExcelCell> cells = new SimpleKeyValueList<String, ExcelCell>();
SimpleKeyValueList<String, String> mergeCellPos = new SimpleKeyValueList<String, String>();
- 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 parseSheet
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public ExcelSheet parseSheet(CharSequence stringFile, CharSequence sheetFile) {
ExcelSheet data = new ExcelSheet();
SimpleKeyValueList<String, ExcelCell> cells = new SimpleKeyValueList<String, ExcelCell>();
SimpleKeyValueList<String, String> mergeCellPos = new SimpleKeyValueList<String, String>();
File ExcelParser.java
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
package de.uniks.networkparser.parser;
import de.uniks.networkparser.DateTimeEntity;
import de.uniks.networkparser.EntityCreator;
import de.uniks.networkparser.EntityUtil;
Method readCSV
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public SimpleList<Object> readCSV(Buffer data, SendableEntityCreator creator) {
SimpleList<Object> result = new SimpleList<Object>();
if (data == null || creator == null) {
return result;
}
- 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 readCSV
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public SimpleList<Object> readCSV(Buffer data, SendableEntityCreator creator) {
SimpleList<Object> result = new SimpleList<Object>();
if (data == null || creator == null) {
return result;
}
Avoid deeply nested control flow statements. Open
if (CELL_TYPE_REFERENCE.equalsIgnoreCase(excelCell.getType())) {
/* <v>2</v> */
EntityList element = cell.getChild(0);
if (element != null) {
String ref = ((XMLEntity) element).getValue();
Avoid deeply nested control flow statements. Open
if (item == null || item.x < 0 || item.y < 0) {
continue;
}
Avoid deeply nested control flow statements. Open
if (CELL.equalsIgnoreCase(cell.getTag()) == false) {
continue;
}
Avoid deeply nested control flow statements. Open
if (item == null || item instanceof ExcelCell == false) {
continue;
}
Method writeCSV
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public CharacterBuffer writeCSV(SimpleList<SimpleList<ExcelCell>> data) {
CharacterBuffer result = new CharacterBuffer();
if (data == null) {
return result;
}
- 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 getHeaderWorkbook
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private String getHeaderWorkbook(ExcelWorkBook content, int id) {
CharacterBuffer data = new CharacterBuffer().with(HEADER);
data.with(
"<workbook xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\">\r\n <sheets>\r\n");
for (int i = 0; i < content.size(); 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"