fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/xml/ArtifactFile.java

Summary

Maintainability
F
4 days
Test Coverage

File ArtifactFile.java has 560 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.uniks.networkparser.xml;

/*
NetworkParser
The MIT License
Severity: Major
Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.java - About 1 day to fix

    ArtifactFile has 53 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class ArtifactFile implements SendableEntityCreatorTag, BaseItem, Comparable<ArtifactFile> {
        public static final String PROPERTY_MODELVERSION = "modelVersion?";
        public static final String PROPERTY_GROUPID = "groupId?";
        public static final String PROPERTY_ARTIFACTID = "artifactId?";
        public static final String PROPERTY_VERSION = "version?";
    Severity: Major
    Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.java - About 7 hrs to fix

      Method calculatePomNumber has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          public boolean calculatePomNumber(int... newSize) {
              int i;
              boolean change = false;
              if (newSize != null) {
                  for (i = 0; i < newSize.length; i++) {
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.java - About 2 hrs 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 createContext has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static final ArtifactFile createContext(String fileName, String groupId, String time) {
              ArtifactFile artifactFile = new ArtifactFile();
              if (fileName == null) {
                  return artifactFile;
              }
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.java - About 1 hr to fix

        Method createContext has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            public static final ArtifactFile createContext(String fileName, String groupId, String time) {
                ArtifactFile artifactFile = new ArtifactFile();
                if (fileName == null) {
                    return artifactFile;
                }
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.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 calculatePomNumber has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public boolean calculatePomNumber(int... newSize) {
                int i;
                boolean change = false;
                if (newSize != null) {
                    for (i = 0; i < newSize.length; i++) {
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.java - About 1 hr to fix

          Method withVersion has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              public ArtifactFile withVersion(String value) {
                  this.version = value;
                  if (value != null) {
                      int start = 0;
                      int pos = 0;
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.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 compareTo has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              @Override
              public int compareTo(ArtifactFile o) {
                  if (o == null) {
                      return 1;
                  }
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.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 toString has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected String toString(int indentFactor, int indent) {
                  String spacesChild = "";
                  String spaces = "";
                  if (indentFactor > 0) {
                      spacesChild = "\r\n" + EntityUtil.repeat(' ', indent + indentFactor);
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.java - About 1 hr to fix

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

                public String toFile(boolean groupPath, String... classifier) {
                    CharacterBuffer file = new CharacterBuffer();
                    file.with(this.artifactId);
                    if (groupPath) {
                        file.with('-');
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.java - About 1 hr to fix

              Method toString has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected String toString(int indentFactor, int indent) {
                      String spacesChild = "";
                      String spaces = "";
                      if (indentFactor > 0) {
                          spacesChild = "\r\n" + EntityUtil.repeat(' ', indent + indentFactor);
              Severity: Minor
              Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.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 withValue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public ArtifactFile withValue(XMLEntity xmlEntity) {
                      for (String property : getProperties()) {
                          Object child = getChild(xmlEntity, property);
                          if (PROPERTY_DEPENDENCIES.equals(property) && child != null) {
                              /* Parse Dependency */
              Severity: Minor
              Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.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 toFile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public String toFile(boolean groupPath, String... classifier) {
                      CharacterBuffer file = new CharacterBuffer();
                      file.with(this.artifactId);
                      if (groupPath) {
                          file.with('-');
              Severity: Minor
              Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.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 getChild has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  private Object getChild(XMLEntity xmlEntity, String value) {
                      if (value == null || xmlEntity == null) {
                          return null;
                      }
              
              
              Severity: Minor
              Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.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

              Avoid too many return statements within this method.
              Open

                          return true;
              Severity: Major
              Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.java - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return null;
                Severity: Major
                Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.java - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return false;
                  Severity: Major
                  Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.java - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return ((ArtifactFile) entity).getScope();
                    Severity: Major
                    Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.java - About 30 mins to fix

                      Method toGITString has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public String toGITString() {
                              if (System.getenv().get("BUILD_NUMBER") != null) {
                                  try {
                                      pomNumber[5] = Integer.valueOf(System.getenv().get("BUILD_NUMBER"));
                                  } catch (Exception e) {
                      Severity: Minor
                      Found in src/main/java/de/uniks/networkparser/xml/ArtifactFile.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