Method indexer
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public ArtifactList indexer(String srcPath, String groupId, String... extension) {
ArtifactList list = new ArtifactList();
File[] listFiles = null;
try {
listFiles = new File(srcPath).listFiles();
- 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 metaFile
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public XMLContainer metaFile(ArtifactList list) {
XMLContainer entity = new XMLContainer().withStandardPrefix();
XMLEntity metadata = entity.createChild("metadata");
if(list == null) {
return entity;
Method indexer
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public ArtifactList indexer(String srcPath, String groupId, String... extension) {
ArtifactList list = new ArtifactList();
File[] listFiles = null;
try {
listFiles = new File(srcPath).listFiles();
Method writeMD5
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean writeMD5(File file) {
if(file == null) {
return false;
}
try {
Method checkForUpdate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static boolean checkForUpdate(String url) {
boolean updated = false;
if (url == 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 writeMavenMetaFile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public void writeMavenMetaFile(ArtifactList list, File path) {
if (list != null && list.size() > 0) {
XMLContainer metaFile = metaFile(list);
FileBuffer.writeFile(path.getAbsolutePath() + File.separator + "maven-metadata.xml", metaFile.toString(2));
if (list.biggestRelease != 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 copyArtefact
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private boolean copyArtefact(ArtifactFile artefact, String path, boolean groupPath) {
if(path == null ||artefact == null) {
return false;
}
File directory = new File(path);
- 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 getSimpleName
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private String getSimpleName(ArtifactFile artifact, String classifier) {
if(artifact == null || artifact.getGroupId() == null) {
return null;
}
if ("pom".equalsIgnoreCase(classifier) || "jar".equalsIgnoreCase(classifier)) {
- 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 metaFile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public XMLContainer metaFile(ArtifactList list) {
XMLContainer entity = new XMLContainer().withStandardPrefix();
XMLEntity metadata = entity.createChild("metadata");
if(list == null) {
return entity;
- 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"