Showing 5 of 12 total issues
Method loadCellValue
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void loadCellValue(CellType type, Field colField, Object target, HSSFCell cell)
throws IllegalAccessException, ParseException {
String fieldType = colField.getType().getSimpleName();
switch (type) {
Method loadCellValue
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static void loadCellValue(CellType type, Field colField, Object target, HSSFCell cell)
throws IllegalAccessException, ParseException {
String fieldType = colField.getType().getSimpleName();
switch (type) {
- 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 getContentByMetas
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static List<Object[]> getContentByMetas(Class target, List<ExcelCellMeta> metaData,
List<? extends ExcelTransform> originData) throws Exception {
// 说明类里没有注解了的字段
if (metaData.size() == 0) {
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
Method mapFieldAndTitle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static String[] mapFieldAndTitle(int colNum, HSSFRow row,
List<ExcelCellMeta> metaList) {
String[] titleList = new String[colNum];
for (int i = 0; i < colNum; i++) {
String temp = row.getCell(i).getStringCellValue();
- 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 getCellMetaData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static List<ExcelCellMeta> getCellMetaData(Class target) {
List<ExcelCellMeta> list = new ArrayList<>();
final Field[] fields = target.getDeclaredFields();
for (Field field : fields) {
if (field.isAnnotationPresent(ExcelConfig.class)) {
- 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"