Method checkMethodsJavaDoc
has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring. Open
private SimpleList<String> checkMethodsJavaDoc(CharacterBuffer text, SimpleList<String> lines, boolean fullCheck,
String currentPackage, String currentFileName) {
SimpleList<String> msg = new SimpleList<String>();
/* Create a matcher to find all method declarations */
Matcher methodPattern = Pattern.compile(
- 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 FileClassModel.java
has 596 lines of code (exceeds 250 allowed). Consider refactoring. Open
package de.uniks.networkparser.ext;
import java.io.File;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Method checkClassJavaDoc
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
private SimpleList<String> checkClassJavaDoc(CharacterBuffer text, SimpleList<String> lines, boolean fullCheck,
String currentPackage, String currentFileName) {
SimpleList<String> msg = new SimpleList<String>();
/*
* First check if the class has java doc, first get the index of "public 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"
Further reading
Method analyseBounds
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
public ClassModel analyseBounds(ClassModel model) {
if (model == null) {
model = this;
}
String search = "import " + model.getName();
- 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 analyseInBoundLinks
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public ClassModel analyseInBoundLinks(ClassModel model) {
if (model == null) {
model = this;
}
for (int i = 0; i < list.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"
Further reading
Method getFiles
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
private void getFiles(File directory, ObjectCondition condition, String parent) {
if (directory.exists() && directory.isDirectory()) {
File[] items = directory.listFiles();
if (items == 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
FileClassModel
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
public class FileClassModel extends ClassModel {
/**
* The suffix of a java file as constant for easer use
*/
private static final String JAVA_FILE_SUFFIX = ".java";
Method checkMethodsJavaDoc
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
private SimpleList<String> checkMethodsJavaDoc(CharacterBuffer text, SimpleList<String> lines, boolean fullCheck,
String currentPackage, String currentFileName) {
SimpleList<String> msg = new SimpleList<String>();
/* Create a matcher to find all method declarations */
Matcher methodPattern = Pattern.compile(
Method checkClassJavaDoc
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
private SimpleList<String> checkClassJavaDoc(CharacterBuffer text, SimpleList<String> lines, boolean fullCheck,
String currentPackage, String currentFileName) {
SimpleList<String> msg = new SimpleList<String>();
/*
* First check if the class has java doc, first get the index of "public class"
Method analyseLoC
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public GraphMetric analyseLoC(Object item) {
String methodBody = null;
Method owner = null;
if (item instanceof GraphModel) {
GraphModel model = (GraphModel) item;
- 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 analyseBounds
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public ClassModel analyseBounds(ClassModel model) {
if (model == null) {
model = this;
}
String search = "import " + model.getName();
Method analyseLoC
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public GraphMetric analyseLoC(Object item) {
String methodBody = null;
Method owner = null;
if (item instanceof GraphModel) {
GraphModel model = (GraphModel) item;
Method analyseInBoundLinks
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public ClassModel analyseInBoundLinks(ClassModel model) {
if (model == null) {
model = this;
}
for (int i = 0; i < list.size(); i++) {
Method getFiles
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void getFiles(File directory, ObjectCondition condition, String parent) {
if (directory.exists() && directory.isDirectory()) {
File[] items = directory.listFiles();
if (items == null) {
return;
Method readFiles
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public boolean readFiles(String path, String type, ObjectCondition... conditions) {
ObjectCondition condition = null;
if (conditions != null && conditions.length > 0) {
condition = conditions[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 extractJavaDocComment
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private String extractJavaDocComment(CharacterBuffer extractFrom, int searchIndex) {
/* Initialize attribute which describe the range of the doc */
int begin = -1;
int end = -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 analyseMcCabe
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public int analyseMcCabe(Object item) {
String methodBody = null;
Method owner = null;
if (item instanceof Method) {
owner = (Method) item;
Avoid deeply nested control flow statements. Open
for (Parameter param : methods.getParameters()) {
if (param.getType().equals(targetClazz)) {
clazz.createBidirectional(targetClazz, "use", Association.ONE, "use", Association.ONE);
break;
}
Method checkClassJavaDoc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private SimpleList<String> checkClassJavaDoc(CharacterBuffer text, SimpleList<String> lines, boolean fullCheck,
String currentPackage, String currentFileName) {
Method checkMethodsJavaDoc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private SimpleList<String> checkMethodsJavaDoc(CharacterBuffer text, SimpleList<String> lines, boolean fullCheck,
String currentPackage, String currentFileName) {
Method check
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private int check(String body, String search) {
int mcCabe = 0;
int index = 0;
while (index >= 0) {
index = body.indexOf(search, index);
- 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"