File Gradle.java
has 603 lines of code (exceeds 250 allowed). Consider refactoring. Open
package de.uniks.networkparser.ext;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
Method extractGradleFiles
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
public void extractGradleFiles(String path, File file) {
if (path == null || file == null) {
return;
}
if (file.exists() == 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 printGraph
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static void printGraph(CharacterBuffer buffer, Object entry, Set<String> edges) {
LinkedList<Object> q = new LinkedList<Object>();
q.add(entry);
HashSet<String> seen = new HashSet<String>();
while (q.isEmpty() == 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 extractGradleFiles
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void extractGradleFiles(String path, File file) {
if (path == null || file == null) {
return;
}
if (file.exists() == false) {
Method initProject
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public boolean initProject(String jarFile, String projectName, String licence) {
if (Os.isReflectionTest() || jarFile == null || projectName == null) {
return false;
}
File file;
- 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 initProject
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean initProject(String jarFile, String projectName, String licence) {
if (Os.isReflectionTest() || jarFile == null || projectName == null) {
return false;
}
File file;
Method writeGradle
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean writeGradle(String path, String projectName, String licence) {
if (Os.isReflectionTest() || path == null) {
return false;
}
Method addAtrifact
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public CharacterBuffer addAtrifact(CharacterBuffer sb, String path, String projectName, String licence) {
if (sb == null) {
sb = new CharacterBuffer();
}
if (projectName == 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
Gradle
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
public class Gradle implements ObjectCondition {
private static final String GRADLE_PROPERTIES = "gradle-wrapper.properties";
private boolean download = true;
public static final String REFLECTIONTEST = "test";
public static final String GIT = "git";
Method addAtrifact
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public CharacterBuffer addAtrifact(CharacterBuffer sb, String path, String projectName, String licence) {
if (sb == null) {
sb = new CharacterBuffer();
}
if (projectName == null) {
Method decompress
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public boolean decompress(String file) {
if (Os.isReflectionTest()) {
return true;
}
if (file == 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 printGraph
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void printGraph(CharacterBuffer buffer, Object entry, Set<String> edges) {
LinkedList<Object> q = new LinkedList<Object>();
q.add(entry);
HashSet<String> seen = new HashSet<String>();
while (q.isEmpty() == false) {
Method writeProjectPath
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void writeProjectPath(String path, String name) {
if (Os.isReflectionTest() || path == null || name == null) {
return;
}
XMLContainer container = new XMLContainer().withStandardPrefix();
Method loadNPM
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public boolean loadNPM() {
if (Os.isReflectionTest()) {
return true;
}
JsonObject packageJson = new JsonObject();
- 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 decompress
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean decompress(String file) {
if (Os.isReflectionTest()) {
return true;
}
if (file == null) {
Method writeGradle
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public boolean writeGradle(String path, String projectName, String licence) {
if (Os.isReflectionTest() || path == 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 execute
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean execute(Object item, String... fileName) {
if (item == null) {
return false;
}
try {
Method loadNPM
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean loadNPM() {
if (Os.isReflectionTest()) {
return true;
}
JsonObject packageJson = new JsonObject();
Method initTest
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void initTest() {
CharacterBuffer buildGradle = FileBuffer.readFile(path + "build.gradle");
buildGradle.withLine("apply plugin: 'jacoco'");
buildGradle.withLine("jacoco.toolVersion = \"0.8.+\"");
Method getLicenceText
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static CharacterBuffer getLicenceText(XMLEntity entity, CharacterBuffer buffer, String projectName) {
if (entity.sizeChildren() > 0) {
for (int c = 0; c < entity.sizeChildren(); c++) {
getLicenceText((XMLEntity) entity.getChild(c), buffer, projectName);
}
- 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
while ((len = zis.read(buffer)) > 0) {
sb.with(buffer, 0, len);
}
Method execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public boolean execute(Object item, String... fileName) {
if (item == null) {
return false;
}
try {
- 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 (start > 0) {
int end = sb.indexOf('\n', start);
if (end > 0) {
String line = sb.substring(start, end);
if (line.indexOf("-snapshots") >= 0) {
TODO found Open
// TODO Auto-generated method stub
- Exclude checks