fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/ext/MavenXML.java

Summary

Maintainability
C
1 day
Test Coverage

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();
Severity: Minor
Found in src/main/java/de/uniks/networkparser/ext/MavenXML.java - About 1 hr to fix

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;
Severity: Minor
Found in src/main/java/de/uniks/networkparser/ext/MavenXML.java - About 1 hr to fix

    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();
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/ext/MavenXML.java - About 1 hr to fix

      Method writeMD5 has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public boolean writeMD5(File file) {
              if(file == null) {
                  return false;
              }
              try {
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/ext/MavenXML.java - About 1 hr to fix

        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;
                }
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/ext/MavenXML.java - About 55 mins to fix

        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) {
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/ext/MavenXML.java - About 45 mins to fix

        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);
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/ext/MavenXML.java - About 35 mins to fix

        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)) {
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/ext/MavenXML.java - About 35 mins to fix

        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;
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/ext/MavenXML.java - About 25 mins to fix

        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

        There are no issues that match your filters.

        Category
        Status